carols10cents commented on a change in pull request #8962:
URL: https://github.com/apache/arrow/pull/8962#discussion_r546068440



##########
File path: cpp/src/arrow/flight/serialization_internal.cc
##########
@@ -374,7 +374,18 @@ grpc::Status FlightDataDeserialize(ByteBuffer* buffer, 
FlightData* out) {
   buffer->Clear();
 
   // TODO(wesm): Where and when should we verify that the FlightData is not
-  // malformed or missing components?
+  // malformed?
+
+  // Set default values for unspecified FlightData fields
+  if (out->app_metadata == nullptr) {
+    out->app_metadata = std::make_shared<Buffer>(nullptr, 0);
+  }
+  if (out->metadata == nullptr) {
+    out->metadata = std::make_shared<Buffer>(nullptr, 0);
+  }

Review comment:
       Whoops! So much for trying to be overly helpful 😅 Pushed a change so 
this just handles `body`.




----------------------------------------------------------------
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:
[email protected]


Reply via email to