Browse Source

HPCC-14104 Check getWorkflowItems() return before using

The 6.0 ESP crashes when running ecl in ECLPLayground.
It happens when ECLPlayground calls WsWorkunits.WUINfo.
The getWorkflowItems() returns NULL when it is called in
WUInfo. WUINfo should check the return before using it.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 9 years ago
parent
commit
0d533d77ff
1 changed files with 4 additions and 1 deletions
  1. 4 1
      esp/services/ws_workunits/ws_workunitsHelpers.cpp

+ 4 - 1
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -1257,8 +1257,11 @@ void WsWuInfo::getWorkflow(IEspECLWorkunit &info, unsigned flags)
         return;
         return;
     try
     try
     {
     {
-        IArrayOf<IConstECLWorkflow> workflows;
         Owned<IConstWorkflowItemIterator> it = cw->getWorkflowItems();
         Owned<IConstWorkflowItemIterator> it = cw->getWorkflowItems();
+        if (!it)
+            return;
+
+        IArrayOf<IConstECLWorkflow> workflows;
         ForEach(*it)
         ForEach(*it)
         {
         {
             IConstWorkflowItem* r = it->query();
             IConstWorkflowItem* r = it->query();