-
Notifications
You must be signed in to change notification settings - Fork 4k
[Firebase_Database] Fix possible NullPointerException #30
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
[Firebase_Database] Fix possible NullPointerException #30
Conversation
@BugsBunnyBR @collinjackson isn't this PR changes FirebaseDatabase plugin behavior contract from:
to:
To be compatible with prievious behaviour this should be changed:
to this:
? |
@audkar, Indeed this would break things, but when is plugin registration happening in any other thread than Main Thread? I think that registering plugins in any thread other than the Main Thread is a mistake and plugins should break if that happens as there is no support to do so in Flutter. (JNI stuff needs to happen in Main Thread as far as I know) |
I manually create®ister plugins in my app context :) Of course I do that on main thread, but still I if would make mistake, than previous implementation would work and current not. |
I don't feel strongly either way. I would be ok with @audkar's |
* feat(firebase_auth): v1 rework (#30) Co-authored-by: Salakar <[email protected]> Co-authored-by: Helena Ford <[email protected]> Co-authored-by: ehesp <[email protected]> Co-authored-by: Kirsty Williams <[email protected]> Co-authored-by: Greg Hesp <[email protected]>
Description
This PR fixes a possible NullPointerException that happens when the plugin is registered without a valid Activity.
I took the opportunity to add some nullability annotations that the IDE was suggesting, those are in the interfaces that are being implemented in the plugin, so should be safe to use.
Related Issues
#19
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?