mirror of https://github.com/apache/cloudstack.git
bug 5119: fixing the npe, the document obj we parse might be null, as a result of which there can be a npe. adding a check against the same
status 5119: resolved fixed
This commit is contained in:
parent
33d97d32c7
commit
5881dfafa6
|
|
@ -1674,8 +1674,15 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR
|
|||
try {
|
||||
doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(statsSource);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Exception caught whilst processing the document via document factory:"+e);
|
||||
return null;
|
||||
}
|
||||
|
||||
if(doc==null){
|
||||
s_logger.warn("Null document found after tryinh to parse the stats source");
|
||||
return null;
|
||||
}
|
||||
|
||||
NodeList firstLevelChildren = doc.getChildNodes();
|
||||
NodeList secondLevelChildren = (firstLevelChildren.item(0)).getChildNodes();
|
||||
Node metaNode = secondLevelChildren.item(0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue