Skip to content

[tool_crash] _TypeError (Null check operator used on a null value) in ResidentHandlers.debugDumpFocusTree #192934

Closed

Description

@bkonyi

Description

In Flutter 3.47.3 crash telemetry, ResidentHandlers.debugDumpFocusTree threw an unhandled _TypeError: Null check operator used on a null value (28 crashes in the first 7 days post-release).

Stack Trace

ResidentHandlers.debugDumpFocusTree at package:flutter_tools/src/resident_runner.dart:628
TerminalHandler._commonTerminalInputHandler at package:flutter_tools/src/resident_runner.dart:1832
TerminalHandler.processTerminalInput at package:flutter_tools/src/resident_runner.dart:1937

Cause

In package:flutter_tools/src/resident_runner.dart:

Future<bool> debugDumpFocusTree() async {
  if (!supportsServiceProtocol || !isRunningDebug) {
    return false;
  }
  for (final FlutterDevice? device in flutterDevices) {
    final List<FlutterView> views = await device!.vmService!.getFlutterViews();
    for (final view in views) {
      final String data = await device.vmService!.flutterDebugDumpFocusTree(
        isolateId: view.uiIsolate!.id!,
      );
      logger.printStatus(data);
    }
  }
  return true;
}

Force unwrapping view.uiIsolate!.id! (or device!.vmService!) throws a null check operator exception if view.uiIsolate is null (e.g. before the isolate finishes initializing or during teardown). Note that debugDumpLayerTree has the identical pattern.

Proposed Fix

Guard view.uiIsolate?.id and device?.vmService with null checks before invoking service extension methods.

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    team-toolOwned by Flutter Tool team
    P1High-priority issues at the top of the work list
    triaged-toolTriaged by Flutter Tool team
    on Sep 17, 2026
  2. self-assigned this
    on Sep 17, 2026
  3. github-actions commented on Oct 30, 2026

    @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.

  4. locked as resolved and limited conversation to collaborators on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolefound in release: 3.47Found to occur in 3.47t: top-crasherteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions