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

_CastError: Null check operator used on a null value #686

Closed
1 task
Tracked by #966
sentry-io bot opened this issue Nov 25, 2021 · 1 comment · Fixed by #967
Closed
1 task
Tracked by #966

_CastError: Null check operator used on a null value #686

sentry-io bot opened this issue Nov 25, 2021 · 1 comment · Fixed by #967
Labels
image carousel https://github.com/openfoodfacts/smooth-app/issues/966

Comments

@sentry-io
Copy link

sentry-io bot commented Nov 25, 2021

Sentry Issue: SMOOTHIE-ANDROID-JQ

What

_CastError: Null check operator used on a null value
  File "carousel_controller.dart", line 106, in CarouselControllerImpl.animateToPage
  File "smooth_product_carousel.dart", line 40, in _SmoothProductCarouselState.didChangeDependencies
...
(158 additional frame(s) were not displayed)

Part of

  • Photo carousel
@monsieurtanuki
Copy link
Contributor

For what it's worth, there's a potential fix for the crash in SmoothProductCarousel:

@override
void didChangeDependencies() {
  super.didChangeDependencies();
  final ContinuousScanModel model = context.watch<ContinuousScanModel>();
  setState(() {
    barcodes = model.getBarcodes();
  });
  if (_controller.ready) { // that's the fix
    _controller.animateToPage(barcodes.length - 1 + _searchCardAdjustment);
  }
}

With that, no crash.
Will the animation take place eventually: I don't know.
Unfortunately I cannot really test that because 1. my smartphone is too old to use https queries (at least with smoothie) and 2. with the emulators I haven't tested how to scan (and anyway my computer is already slow enough).

@teolemon teolemon added the image carousel https://github.com/openfoodfacts/smooth-app/issues/966 label Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
image carousel https://github.com/openfoodfacts/smooth-app/issues/966
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants