-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fix NoneType AttributeError in firefox extension plugin #713
Conversation
Do you have some test data or could you add some data to the unit test for this? Maybe I'm missing something but on first glance the previous code should be functionality identical? In [1]: extension = {}
In [2]: repr(extension.get("defaultLocale", {}).get("name"))
Out[2]: 'None'
In [3]: extension = {"defaultLocale": {}}
In [4]: repr(extension.get("defaultLocale", {}).get("name"))
Out[4]: 'None' |
@Schamper The error occurs if the field
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #713 +/- ##
=======================================
Coverage 75.05% 75.05%
=======================================
Files 295 295
Lines 25084 25084
=======================================
Hits 18827 18827
Misses 6257 6257
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested something a bit more concise.
Co-authored-by: Erik Schamper <[email protected]>
Thanks! Was actually running into this issue too while working on another feature. |
This PR fixes a NoneType AttributeError in the firefox extension plugin.
When parsing the firefox extension information from the json file, we use the dictionary get method to access the relevant key value pairs. However, I ran into an uncatched NoneType AttributeError if the original key value is None, but we expect a nested dictionary, e.g. for the "name" field.
Additionally, the error message was slightly adapted, so instead of logging the whole user object, it now only prints the username as it should.