be defensive

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4404 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-08-23 13:34:41 +00:00
1 parent fbc8d7ca32
commit cef33d0ce2
1 file changed
+6 -1
@@ -37,7 +37,12 @@ public final class SuiteResult implements Serializable {
SuiteResult(File xmlReport) throws DocumentException {
Document result = new SAXReader().read(xmlReport);
Element root = result.getRootElement();
name = root.attributeValue("name");
String name = root.attributeValue("name");
if(name==null)
// some user reported that name is null in their environment.
// see http://www.nabble.com/Unexpected-Null-Pointer-Exception-in-Hudson-1.131-tf4314802.html
name = '('+xmlReport.getName()+')';
this.name = name;
stdout = root.elementText("system-out");
stderr = root.elementText("system-err");