-
Notifications
You must be signed in to change notification settings - Fork 11
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
Navigator.pushAndRemoveUntil throws exception in Bugsnag #242
Conversation
@@ -291,7 +291,7 @@ Void clearFeatureFlags(@Nullable JSONObject args) { | |||
} | |||
|
|||
Void addMetadata(@Nullable JSONObject args) throws JSONException { | |||
if (args == null || !args.has("section") || !args.has("metadata")) { | |||
if (args == null || !hasString(args,"section") || args.has("metadata")) { |
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.
nit: formatting
if (args == null || !hasString(args,"section") || args.has("metadata")) { | |
if (args == null || !hasString(args, "section") || args.has("metadata")) { |
packages/bugsnag_flutter/android/src/main/java/com/bugsnag/flutter/BugsnagFlutter.java
Outdated
Show resolved
Hide resolved
packages/bugsnag_flutter/android/src/main/java/com/bugsnag/flutter/BugsnagFlutter.java
Outdated
Show resolved
Hide resolved
@@ -317,7 +317,7 @@ Void clearMetadata(@Nullable JSONObject args) throws JSONException { | |||
} | |||
|
|||
JSONObject getMetadata(@Nullable JSONObject args) throws JSONException { | |||
if (args == null || !args.has("section")) { | |||
if (args == null || !hasString(args,"section")) { |
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.
nit: formatting
if (args == null || !hasString(args,"section")) { | |
if (args == null || !hasString(args,"section")) { |
if (!args.has(key)) { | ||
return null; | ||
} |
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.
I think this check is redundant, if args.get(key)
returns null
the instanceof String
check will fail and we return null
.
Co-authored-by: Jason <lemnik@users.noreply.github.com>
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.
LGTM
Goal
Fixed an issue related to setting context by navigator observer. In some cases a null is received on Android as a JSONObject.
Changeset
Added safety checks
Testing
Manual testing