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

Repeated "Null check operator used on a null value. Error thrown null" error #28

Open
egonbeermat opened this issue Feb 7, 2023 · 1 comment

Comments

@egonbeermat
Copy link

egonbeermat commented Feb 7, 2023

Hi, I am unable to reproduce this issue locally myself on any devices or simulators, Android or iOS, but in Crashlytics I am repeatedly seeing this reported crash in production:

Null check operator used on a null value. Error thrown null.
at OverlayEntry.remove(overlay.dart:163)
at ToastFuture.dismiss(styled_toast_manage.dart:73)
at new ToastFuture.create.(styled_toast_manage.dart:50)

It seems that this call in your code to remove an OverlayEntry is called on a null entry, which causes the issue in the Flutter SDK:

styled_toast_manage.dart:73 _entry.remove();

It is being reported from both iOS and Android devices, on a range of operating system versions too. Flutter version is 3.3.10. Any pointers or workarounds would be appreciated, as I'm at a loss how to control this, and this is now my most common crash.

@egonbeermat
Copy link
Author

Assuming this component is abandoned due to the general lack of updates and responses to issues, but for anyone with this issue it can be resolved by modifying styled_toast_manage.dart:73 to:

if (_entry.mounted) {
  _entry.remove();
}

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

No branches or pull requests

1 participant