Skip to content

fix: raise a descriptive KeyError instead of crashing when frame_by_i… - #922

Open
jonahdagher wants to merge 1 commit into
ebroecker:developmentfrom
jonahdagher:fix-860-frame-by-id-none
Open

jonahdagher wants to merge 1 commit into
ebroecker:developmentfrom
jonahdagher:fix-860-frame-by-id-none

Conversation

@jonahdagher

Copy link
Copy Markdown

"CanMatrix.encode()" calls "encode(data)" directly on the result of "frame_by_id()", which will return "None" if the frame id isn't found

This PR adds a None check so a "KeyError" can be raised as opposed to an unrelated crash occurring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant