szaszm commented on code in PR #1900:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1900#discussion_r1859133332


##########
extensions/windows-event-log/wel/MetadataWalker.cpp:
##########
@@ -90,10 +86,11 @@ bool MetadataWalker::for_each(pugi::xml_node &node) {
     if (it != formatFlagMap.end()) {
       std::function<std::string(const std::string &)> updateFunc = [&](const 
std::string &input) -> std::string {
         if (resolve_) {
-          auto resolved = windows_event_log_metadata_.getEventData(it->second);
-          if (!resolved.empty()) {
-            return resolved;
+          const auto resolved = 
windows_event_log_metadata_.getEventData(it->second);
+          if (resolved && !resolved->empty()) {
+            return *resolved;
           }
+          // TODO(szaszm): add error logging

Review Comment:
   One behavior change in `getEventData`: allocation failure now returns an 
`error_code`, instead of an empty string. Since both empty strings and errors 
are ignored here, there is no change in overall behavior. Added a comment to do 
proper error handling later, but I didn't wanna do it in the context of this 
change. (`MetadataWalker` has no logger.)



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to