Skip to content

_CastError: Null check operator used on a null value at MaterialFonts.updateInner(flutter_cache.dart:141) #90092

Closed

Description

@jmagman

Number 6 crasher on Flutter 2.5

Thread 0 main thread_CastError: Null check operator used on a null value
at MaterialFonts.updateInner(flutter_cache.dart:141)
at CachedArtifact.update(cache.dart:688)
at Cache.updateAll(cache.dart:557)
at <asynchronous gap>(async)
at FlutterCommand.verifyThenRunCommand(flutter_command.dart:1228)
at <asynchronous gap>(async)
at FlutterCommand.run.<anonymous closure>(flutter_command.dart:1125)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at CommandRunner.runCommand(command_runner.dart:209)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand.<anonymous closure>(flutter_command_runner.dart:288)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at FlutterCommandRunner.runCommand(flutter_command_runner.dart:236)
at <asynchronous gap>(async)
at run.<anonymous closure>.<anonymous closure>(runner.dart:62)
at <asynchronous gap>(async)
at AppContext.run.<anonymous closure>(context.dart:150)
at <asynchronous gap>(async)
at main(executable.dart:92)
at <asynchronous gap>(async)

final Uri archiveUri = _toStorageUri(version!);

Caused by #85242 (comment)

I think the right thing to do is ! so if it does fail it shows up in crash logging

Activity

  1. added
    c: crashStack traces logged to the console
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Sep 15, 2021
  2. changed the title [-]thread_CastError: Null check operator used on a null value at MaterialFonts.updateInner(flutter_cache.dart:141)[/-] [+]_CastError: Null check operator used on a null value at MaterialFonts.updateInner(flutter_cache.dart:141)[/+] on Sep 15, 2021
  3. jmagman commented on Sep 15, 2021

    @jmagman
    MemberAuthor

    A check for version existence was added after updateInner (too late) in #79864. I'm not sure why version is null at this point.

  4. added
    P2Important issues not at the top of the work list
    on Jan 27, 2022
  5. christopherfujino commented on Jan 27, 2022

    @christopherfujino
    Contributor

    it looks to me like this can only be null if the version file does not exist on disk: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/cache.dart#L609

        return versionFile.existsSync() ? versionFile.readAsStringSync().trim() : null;
    

    I'm not sure how that is possible though...

  6. christopherfujino commented on Jan 27, 2022

    @christopherfujino
    Contributor

    Ohh, actually, if I look at this: #91942

    The user does not have an engine version too, and are on Windows. I wonder if this is the unzipping error where not all files are present?

  7. removed their assignment
    on Jan 27, 2022
  8. christopherfujino commented on Jan 17, 2024

    @christopherfujino
    Contributor

    A newer stacktrace from #141450 at stable 3.13.1

    _TypeError: (#0 MaterialFonts.updateInner (package:flutter_tools/src/flutter_cache.dart:151:49))
    
    #0      MaterialFonts.updateInner (package:flutter_tools/src/flutter_cache.dart:151:49)
    #1      CachedArtifact.update (package:flutter_tools/src/cache.dart:812:11)
    #2      Cache.updateAll (package:flutter_tools/src/cache.dart:679:24)
    <asynchronous suspension>
    #3      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1566:7)
    <asynchronous suspension>
    #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1297:27)
    <asynchronous suspension>
    #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
    <asynchronous suspension>
    #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:339:9)
    <asynchronous suspension>
    #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:285:5)
    <asynchronous suspension>
    #10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:115:9)
    <asynchronous suspension>
    #11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
    <asynchronous suspension>
    #12     main (package:flutter_tools/executable.dart:90:3)
    <asynchronous suspension>
    
  9. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jul 11, 2025
  10. added a commit that references this issue on Aug 24, 2026
    0c0d059
  11. github-actions commented on Sep 7, 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: crashStack traces logged to the consoleteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.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