Skip to content

DragGestureRecognizer.acceptGesture null check operator used on a null value #112403

Description

@christopherfujino

Framework crash from internal b/249091367

UnknownError: Null check operator used on a null value
at DragGestureRecognizer.acceptGesture(monodrag.dart:334)
at GestureArenaManager._resolveByDefault(arena.dart:251)
at GestureArenaManager._tryToResolveArena.<anonymous closure>(arena.dart:232)
at _rootRun(zone.dart:1418)
at _rootRun(zone.dart:1417)
at _CustomZone.run(zone.dart:1328)
at _CustomZone.runGuarded(zone.dart:1236)
at _CustomZone.bindCallbackGuarded.<anonymous closure>(zone.dart:1276)
at _rootRun(zone.dart:1426)
at _rootRun(zone.dart:1417)
at _CustomZone.run(zone.dart:1328)
at _CustomZone.runGuarded(zone.dart:1236)
at _CustomZone.bindCallbackGuarded.<anonymous closure>(zone.dart:1276)
at _microtaskLoop(schedule_microtask.dart:40)
at _startMicrotaskLoop(schedule_microtask.dart:49)
at _startMicrotaskLoop(schedule_microtask.dart:44)

Although the line numbers are different (I'm not sure the exact framework version used in the app this stacktrace is from), I'm pretty sure it's this line: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/gestures/monodrag.dart#L367

      final Duration timestamp = _lastPendingEventTimestamp!;

It's difficult to reason about how we got into this state, but maybe the easiest fix would be to just let _checkStart(timestamp, pointer) be a no-op when timestamp == null, WDYT @dkwingsmt?

Activity

  1. added
    c: crashStack traces logged to the console
    P2Important issues not at the top of the work list
    on Sep 27, 2022
  2. self-assigned this
    on Dec 22, 2022
  3. tarobins commented on Dec 22, 2022

    @tarobins
    Contributor

    DragStartDetails.sourceTimeStamp can be null, so the timestamp parameter to _checkStart can be null, so there is no need to unwrap _lastPendingEventTimestamp.

  4. added 2 commits that reference this issue on Dec 22, 2022
    b2743fc
    7728232
  5. added a commit that references this issue on Feb 28, 2023
  6. added a commit that references this issue on Feb 28, 2023
  7. github-actions commented on Mar 14, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: crashStack traces logged to the consolecustomer: dream (g3)f: gesturesflutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions