Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jmagman opened this issue Sep 15, 2021 · 4 comments
Labels
c: crash Stack traces logged to the console P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team

Comments

@jmagman
Copy link
Member

jmagman commented Sep 15, 2021

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

@jmagman jmagman added c: crash Stack traces logged to the console tool Affects the "flutter" command-line tool. See also t: labels. labels Sep 15, 2021
@jmagman jmagman 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) Sep 15, 2021
@jmagman
Copy link
Member Author

jmagman commented Sep 15, 2021

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

@christopherfujino
Copy link
Member

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

@christopherfujino
Copy link
Member

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?

@christopherfujino
Copy link
Member

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: crash Stack traces logged to the console P2 Important issues not at the top of the work list team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team
Projects
None yet
Development

No branches or pull requests

4 participants