Skip to content

Avoid potential exception - #1753

Open
selescop wants to merge 1 commit into
pyocd:developfrom
schneider-electric:hotfix/fix_potential_exception
Open

Avoid potential exception#1753
selescop wants to merge 1 commit into
pyocd:developfrom
schneider-electric:hotfix/fix_potential_exception

Conversation

@selescop

Copy link
Copy Markdown

when 'product_name' is not specified
(a call to to_str_safe() will trigger an exception)

when 'product_name' is not specified
(a call to to_str_safe() will trigger an exception)

Signed-off-by: Cedric Lescop <cedric.lescop@se.com>
@RobertRostohar

Copy link
Copy Markdown
Collaborator

Sorry for not looking into this earlier.

When would deviceInfo['product_string'] be None?

Looking at hid.enumerate from cython-hidapi 0.14:
When there is no product_string, the NULL C pointer is converted to "" and not None.

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.

2 participants