Skip to content

Conversation

@tarobins
Copy link
Contributor

@tarobins tarobins commented Dec 22, 2022

Avoid unnecessary unwrap of _lastPendingEventTimestamp which sometimes causes "Null check operator used on a null"

Fixes #112403

List which issues are fixed by this PR. You must list at least one issue.

112403

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • [ x ] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [ x ] I read the Tree Hygiene wiki page, which explains my responsibilities.
  • [ x ] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • [x ] I signed the CLA.
  • [ x ] I listed at least one issue that this PR fixes in the description above.
  • [ x ] I updated/added relevant documentation (doc comments with ///).
  • [ ] I added new tests to check the change I am making, or this PR is test-exempt.
  • [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

…mes causes "Null check operator used on a null"

Fixes flutter#112403
@flutter-dashboard flutter-dashboard bot added f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels. labels Dec 22, 2022
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@dkwingsmt
Copy link
Contributor

dkwingsmt commented Dec 22, 2022

This can fix the problem for sure, but I don't think simply making this change without understand how _lastPendingEventTimestamp can be null is a good idea. At the very least, we can't write a unit test for this PR.

@tarobins tarobins requested a review from dkwingsmt December 22, 2022 21:33
@goderbauer
Copy link
Member

@tarobins Can you please add a test for this?

@goderbauer
Copy link
Member

(Triage): I am going to close this one since there was no follow-up. Looks like we have an issue on file to keep track of this work. If you (or anyone else) finds the time to work on this again, feel free to reopen. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DragGestureRecognizer.acceptGesture null check operator used on a null value

3 participants