Skip to content

Commit

Permalink
fix(pointcloud2): do not crash on empty pointcloud
Browse files Browse the repository at this point in the history
Fixes dheera#85
  • Loading branch information
reinzor committed Nov 25, 2024
1 parent c09020f commit 030f785
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rosboard/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def ros2dict(msg):
# PointCloud2: extract only necessary fields, reduce precision
if (msg.__module__ == "sensor_msgs.msg._PointCloud2" or \
msg.__module__ == "sensor_msgs.msg._point_cloud2") \
and field == "data":
and field == "data" and msg.data:
rosboard.compression.compress_point_cloud2(msg, output)
continue

Expand Down

0 comments on commit 030f785

Please sign in to comment.