Skip to content

Commit

Permalink
Handle take failure in wait_for_message (#1172)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
mhidalgo-bdai authored Sep 28, 2023
1 parent 827d597 commit 5ee7ad4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rclpy/rclpy/wait_for_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def wait_for_message(
if subs_ready:
if sub.handle.pointer in subs_ready:
msg_info = sub.handle.take_message(sub.msg_type, sub.raw)
return (True, msg_info[0])
if msg_info is not None:
return (True, msg_info[0])

return (False, None)

0 comments on commit 5ee7ad4

Please sign in to comment.