Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return nullptr when message fails to populate #384

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

mjcarroll
Copy link
Contributor

When creating a message with user-provided string data, in the event that the string data isn't well formed, we should be returning a nullptr rather than an empty message. This indicates to the caller that we failed to create the full message.

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #384 (4bb4904) into gz-msgs10 (50ee1e4) will increase coverage by 0.00%.
Report is 1 commits behind head on gz-msgs10.
The diff coverage is 100.00%.

❗ Current head 4bb4904 differs from pull request most recent head fae61ec. Consider uploading reports for the commit fae61ec to get more accurate results

@@            Coverage Diff             @@
##           gz-msgs10     #384   +/-   ##
==========================================
  Coverage      97.26%   97.26%           
==========================================
  Files             27       27           
  Lines           1169     1170    +1     
==========================================
+ Hits            1137     1138    +1     
  Misses            32       32           
Files Changed Coverage Δ
core/include/gz/msgs/PointCloudPackedUtils.hh 94.91% <ø> (ø)
core/src/MessageFactory.cc 97.91% <100.00%> (+0.04%) ⬆️

Copy link
Collaborator

@caguero caguero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Signed-off-by: Michael Carroll <[email protected]>
@mjcarroll
Copy link
Contributor Author

Looks good to me!

I ended up also adding a test here to prevent regressions

@mjcarroll mjcarroll merged commit 9b6a7d8 into gz-msgs10 Sep 21, 2023
@mjcarroll mjcarroll deleted the mjcarroll/check_message_population branch September 21, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants