Browse Source

HPCC-15171 Fix compilation warning

    - Initialize variable and check for NULL before use

Signed-off-by: Gleb Aronsky <gleb.aronsky@lexisnexis.com>
Gleb Aronsky 9 years ago
parent
commit
62ad2c9098
1 changed files with 2 additions and 2 deletions
  1. 2 2
      esp/services/WsDeploy/WsDeployService.cpp

+ 2 - 2
esp/services/WsDeploy/WsDeployService.cpp

@@ -4197,7 +4197,7 @@ bool CWsDeployFileInfo::handleHardwareCopy(IPropertyTree *pComponents, IProperty
 {
 {
     bool bWrite = false;
     bool bWrite = false;
     StringBuffer filePath;
     StringBuffer filePath;
-    IPropertyTree* dupTree;
+    IPropertyTree* dupTree = NULL;
 
 
     Owned<IPropertyTreeIterator> iterComp = pComponents->getElements("*");
     Owned<IPropertyTreeIterator> iterComp = pComponents->getElements("*");
 
 
@@ -4249,7 +4249,7 @@ bool CWsDeployFileInfo::handleHardwareCopy(IPropertyTree *pComponents, IProperty
     }
     }
     else
     else
     {
     {
-        VStringBuffer err("Copy failed. Element %s may already exist in the target configuration.", dupTree->queryProp(XML_ATTR_NAME));
+        VStringBuffer err("Copy failed. Element %s may already exist in the target configuration.", dupTree ? dupTree->queryProp(XML_ATTR_NAME) : "");
         throw MakeStringException(-1, "%s", err.str());
         throw MakeStringException(-1, "%s", err.str());
     }
     }
     return true;
     return true;