浏览代码

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 年之前
父节点
当前提交
62ad2c9098
共有 1 个文件被更改,包括 2 次插入2 次删除
  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;