Skip to content

_CastError in SemanticsOwner.performAction #100358

@koral--

Description

@koral--

Steps to Reproduce

This is an automated anonymous crash report.
According to breadcrumbs, it happened right after navigating to a page.

Expected results:
No exception is thrown.

Actual results:

_CastError: Null check operator used on a null value
  File "semantics.dart", line 3092, in SemanticsOwner.performAction
  File "binding.dart", line 347, in RendererBinding._handleSemanticsAction
  File "hooks.dart", line 210, in _invoke3.<fn>
  File "zone.dart", line 1428, in _rootRun
  File "zone.dart", line 1328, in _CustomZone.run
  File "zone.dart", line 1236, in _CustomZone.runGuarded
  File "hooks.dart", line 209, in _invoke3
  File "platform_dispatcher.dart", line 919, in PlatformDispatcher._dispatchSemanticsAction
  File "hooks.dart", line 98, in _dispatchSemanticsAction
Code sample No app code is involved. Check `SemanticsOwner` in this repo.
Logs

N/A

No issues found!

App was built on CI, some time ago, so I could not execute shell commands. However, here is the relevant part of the log which is available:

Flutter 2.8.1 • channel unknown • unknown source
Framework • revision 77d935af4d (3 months ago) • 2021-12-16 08:37:33 -0800
Engine • revision 890a5fca2e
Tools • Dart 2.15.1

It looks like there is an issue with code here: https://github.com/flutter/flutter/blob/flutter-2.8-candidate.20/packages/flutter/lib/src/semantics/semantics.dart#L3092

    if (action == SemanticsAction.showOnScreen && _nodes[id]!._showOnScreen != null)
      _nodes[id]!._showOnScreen!();
  }

_nodes[id] turned out to be bull, the same code is still there on master, only line numbers are slightly changed.
The trivial fix is to add a nullcheck for _nodes[id]. However, there might be a deeper error.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: productionIssues experienced in live production appsc: crashStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions