Browse Source

Merge pull request #11419 from afishbeck/cloneQuerySetSegFault

HPCC-20093 Fix segfault when cloning query set

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 years ago
parent
commit
ed728c09b3
1 changed files with 5 additions and 1 deletions
  1. 5 1
      esp/services/ws_workunits/ws_workunitsQuerySets.cpp

+ 5 - 1
esp/services/ws_workunits/ws_workunitsQuerySets.cpp

@@ -693,6 +693,9 @@ static inline void updateQueryPriority(IPropertyTree *queryTree, const char *val
 
 
 void gatherFileErrors(IReferencedFileList *files, IArrayOf<IConstLogicalFileError> &errors)
 void gatherFileErrors(IReferencedFileList *files, IArrayOf<IConstLogicalFileError> &errors)
 {
 {
+    if (!files)
+        return;
+
     Owned<IReferencedFileIterator> it = files->getFiles();
     Owned<IReferencedFileIterator> it = files->getFiles();
     ForEach(*it)
     ForEach(*it)
     {
     {
@@ -2672,7 +2675,8 @@ public:
     }
     }
     void gatherFileErrors(IArrayOf<IConstLogicalFileError> &errors)
     void gatherFileErrors(IArrayOf<IConstLogicalFileError> &errors)
     {
     {
-        ::gatherFileErrors(wufiles, errors);
+        if (wufiles)
+            ::gatherFileErrors(wufiles, errors);
     }
     }
 
 
 private:
 private: