Explorar o código

Merge pull request #14404 from jakesmith/hpcc-25095-json-null

HPCC-25095 Json push parser losing null value properties

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday %!s(int64=4) %!d(string=hai) anos
pai
achega
d78d244297
Modificáronse 1 ficheiros con 22 adicións e 23 borrados
  1. 22 23
      system/jlib/jptree.cpp

+ 22 - 23
system/jlib/jptree.cpp

@@ -7288,35 +7288,34 @@ public:
     {
     {
         offset_t startOffset = curOffset;
         offset_t startOffset = curOffset;
         StringBuffer value;
         StringBuffer value;
-        if (readValue(value)==elementTypeNull)
-            return;
-
-        if ('@'==*name)
-        {
-            if (!skipAttributes)
-                iEvent->newAttribute(name, value.str());
-            return;
-        }
-        else if ('#'==*name)
+        if (readValue(value)!=elementTypeNull)
         {
         {
-            dbgassertex(retValue && isValueBinary);
-            *isValueBinary = false;
-            if (0 == strncmp(name+1, "value", 5)) // this is a special IPT JSON prop name, representing a 'complex' value
+            if ('@'==*name)
             {
             {
-                if ('\0' == *(name+6)) // #value
-                {
-                    retValue->swapWith(value);
-                    return;
-                }
-                else if (streq(name+6, "bin")) // #valuebin
+                if (!skipAttributes)
+                    iEvent->newAttribute(name, value.str());
+                return;
+            }
+            else if ('#'==*name)
+            {
+                dbgassertex(retValue && isValueBinary);
+                *isValueBinary = false;
+                if (0 == strncmp(name+1, "value", 5)) // this is a special IPT JSON prop name, representing a 'complex' value
                 {
                 {
-                    *isValueBinary = true;
-                    JBASE64_Decode(value.str(), *retValue);
-                    return;
+                    if ('\0' == *(name+6)) // #value
+                    {
+                        retValue->swapWith(value);
+                        return;
+                    }
+                    else if (streq(name+6, "bin")) // #valuebin
+                    {
+                        *isValueBinary = true;
+                        JBASE64_Decode(value.str(), *retValue);
+                        return;
+                    }
                 }
                 }
             }
             }
         }
         }
-
         iEvent->beginNode(name, false, startOffset);
         iEvent->beginNode(name, false, startOffset);
         iEvent->beginNodeContent(name);
         iEvent->beginNodeContent(name);
         iEvent->endNode(name, value.length(), value.str(), false, curOffset);
         iEvent->endNode(name, value.length(), value.str(), false, curOffset);