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

Raise an exception when type is None #32

Merged
merged 1 commit into from
Jun 6, 2023
Merged

Conversation

Nauja
Copy link
Collaborator

@Nauja Nauja commented Jun 5, 2023

As the parameter type can be None in ContextMenu, it's unclear at first glance why creating a ContextMenu without a type, and calling compile on it, raises the exception 'NoneType' object has no attribute 'upper'.

cm = ContextMenu("Name")
cm.compile() <- exception

This change adds a better error message for when compile is called on the top-level ContextMenu, so that it's more clear what the problem is

Ref #31

As the parameter type can be None in ContextMenu, it's unclear
at first glance why creating a ContextMenu without a type, and
calling compile on it, raises the exception
"'NoneType' object has no attribute 'upper'".

cm = ContextMenu("Name")
cm.compile() <- exception

This change adds a better error message for when compile is
called on the top-level ContextMenu, so that it's more clear
what the problem is

Ref saleguas#31
@saleguas saleguas merged commit c97bd4c into saleguas:master Jun 6, 2023
6 checks passed
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.

None yet

2 participants