adamdebreceni commented on a change in pull request #932:
URL: https://github.com/apache/nifi-minifi-cpp/pull/932#discussion_r514186240



##########
File path: libminifi/src/provenance/Provenance.cpp
##########
@@ -346,25 +352,33 @@ bool ProvenanceEventRecord::DeSerialize(const uint8_t 
*buffer, const size_t buff
     }
 
     for (uint32_t i = 0; i < number; i++) {
-      std::string parentUUID;
-      ret = outStream.read(parentUUID);
+      std::string parentUUIDStr;
+      ret = outStream.read(parentUUIDStr);
       if (ret <= 0) {
         return false;
       }
-      this->addParentUuid(parentUUID);
+      utils::optional<utils::Identifier> parentUUID = 
utils::Identifier::parse(parentUUIDStr);
+      if (!parentUUID) {
+        return false;
+      }
+      this->addParentUuid(parentUUID.value());
     }
     number = 0;
     ret = outStream.read(number);
     if (ret != 4) {
       return false;
     }
     for (uint32_t i = 0; i < number; i++) {
-      std::string childUUID;
-      ret = outStream.read(childUUID);
+      std::string childUUIDStr;
+      ret = outStream.read(childUUIDStr);
       if (ret <= 0) {
         return false;
       }
-      this->addChildUuid(childUUID);
+      utils::optional<utils::Identifier> childUUID = 
utils::Identifier::parse(childUUIDStr);
+      if (!childUUID) {
+        return false;
+      }
+      this->addChildUuid(childUUID.value());

Review comment:
       added, also added an `OutputStream:read` overload for symmetry




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to