소스 검색

Merge pull request #10881 from rpastrana/HPCC-19111-JSONRespSample

HPCC-19111 Prevent ESP termination upon JSON sample request

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 년 전
부모
커밋
7a3e3520a5
1개의 변경된 파일9개의 추가작업 그리고 6개의 파일을 삭제
  1. 9 6
      esp/services/common/jsonhelpers.hpp

+ 9 - 6
esp/services/common/jsonhelpers.hpp

@@ -324,12 +324,15 @@ namespace JsonHelpers
             {
                 if (flags & REQSF_ROOT)
                 {
-                    bool log = reqTree->getPropBool("@log", false); //not in schema
-                    if (log)
-                        appendJSONValue(out, "@log", true);
-                    int tracelevel = reqTree->getPropInt("@traceLevel", -1);
-                    if (tracelevel>=0)
-                        appendJSONValue(out, "@traceLevel", tracelevel);
+                    if (reqTree)
+                    {
+                        bool log = reqTree->getPropBool("@log", false); //not in schema
+                        if (log)
+                            appendJSONValue(out, "@log", true);
+                        int tracelevel = reqTree->getPropInt("@traceLevel", -1);
+                        if (tracelevel>=0)
+                            appendJSONValue(out, "@traceLevel", tracelevel);
+                    }
                 }
                 int flds = type->getFieldCount();
                 for (int idx=0; idx<flds; idx++)