Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 85c299904 -> 19b8c887f


MINIFICPP-557: Previously the empty flag was not a necessary check as we didn't
have the case where empty ValueNodes could or should occur ( and these were 
dealt with elsewhere)
but recent changes have made this a new requirement thus we can add the empty 
check
for validation of lists.

This closes #372.

Signed-off-by: Aldrin Piri <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/19b8c887
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/19b8c887
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/19b8c887

Branch: refs/heads/master
Commit: 19b8c887f018a957f76f44fa9cae37840bab17c6
Parents: 85c2999
Author: Marc Parisi <[email protected]>
Authored: Mon Jul 16 14:22:24 2018 -0400
Committer: Aldrin Piri <[email protected]>
Committed: Mon Jul 16 15:48:10 2018 -0400

----------------------------------------------------------------------
 libminifi/src/c2/protocols/RESTProtocol.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/19b8c887/libminifi/src/c2/protocols/RESTProtocol.cpp
----------------------------------------------------------------------
diff --git a/libminifi/src/c2/protocols/RESTProtocol.cpp 
b/libminifi/src/c2/protocols/RESTProtocol.cpp
index 9439ac6..391ed81 100644
--- a/libminifi/src/c2/protocols/RESTProtocol.cpp
+++ b/libminifi/src/c2/protocols/RESTProtocol.cpp
@@ -133,7 +133,6 @@ void setJsonStr(const std::string& key, const 
state::response::ValueNode& value,
   rapidjson::Value keyVal;
   rapidjson::Value valueVal;
   const char* c_key = key.c_str();
-
   auto base_type = value.getValue();
   keyVal.SetString(c_key, key.length(), alloc);
 
@@ -201,7 +200,9 @@ void RESTProtocol::mergePayloadContent(rapidjson::Value 
&target, const C2Payload
     bool use_sub_option = true;
     if (payload_content.op == payload.getOperation()) {
       for (auto content : payload_content.operation_arguments) {
-        setJsonStr(content.first, content.second, target, alloc);
+        if (!content.second.empty()) {
+          setJsonStr(content.first, content.second, target, alloc);
+        }
       }
     } else {
     }

Reply via email to