[go: nahoru, domu]

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

[Crash] Null check operator used on a null value #256

Closed
trulykasodiya-hub opened this issue Mar 7, 2023 · 7 comments
Closed

[Crash] Null check operator used on a null value #256

trulykasodiya-hub opened this issue Mar 7, 2023 · 7 comments

Comments

@trulykasodiya-hub
Copy link

PagingController.notifyStatusListeners package:infinite_scroll_pagination/src/core/paging_controller.dart:170
Null check operator used on a null value

0 PagingController.notifyStatusListeners package:infinite_scroll_pagination/src/core/paging_controller.dart:170
1 PagingController.value= package:infinite_scroll_pagination/src/core/paging_controller.dart:94
2 PagingController.error= package:infinite_scroll_pagination/src/core/paging_controller.dart:69
3 _SalesOrdersBodyState._fetchPage package:mobile/View/Screen/Sales_Order/sales_orders.dart:76
@cornetthomas
Copy link
Contributor
/// Calls all the status listeners.
  ///
  /// If listeners are added or removed during this function, the modifications
  /// will not change which listeners are called during this iteration.
  void notifyStatusListeners(PagingStatus status) {
    assert(_debugAssertNotDisposed());

    if (_statusListeners!.isEmpty) {
      return;
    }

    final localListeners = List<PagingStatusListener>.from(_statusListeners!);
    localListeners.forEach((listener) {
      if (_statusListeners!.contains(listener)) {
        listener(status);
      }
    }

Any reason we should expect _statusListeners to never be null?
In case you dispose the paging_controller and a callback still happens this can be null.

It would be safer to use _statusListeners?without any downside here?

@cornetthomas
Copy link
Contributor

I guess it is similar as in #246

cornetthomas added a commit to cornetthomas/infinite_scroll_pagination that referenced this issue Dec 15, 2023
@cornetthomas
Copy link
Contributor

@EdsonBueno I created a PR for your review

@ItsYasser
Copy link

was this really fixed ? i'm still having the same issue in my crash analytics even thought i upgraded the package to the last version

@acudworth
Copy link

Would be good to get @cornetthomas's PR merged in and a fix out for this. Very much a live issue right now @EdsonBueno.

@pixnbit
Copy link
pixnbit commented Feb 1, 2024

Is this library still maintained? The PR looks very straightforward

@matmicro
Copy link

Any progress on this fix ?
Is there a chance to get this released ?

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

7 participants