[flutter_tools] handle null package (#75336)

This commit is contained in:
Jonah Williams
2021-02-03 10:53:30 -08:00
committed by GitHub
parent 3b884aa613
commit deb5e40f53
2 changed files with 15 additions and 1 deletions

View File

@@ -86,7 +86,7 @@ LanguageVersion determineLanguageVersion(File file, Package package) {
// If the language version cannot be found, use the package version.
if (package != null) {
return package.languageVersion;
return package.languageVersion ?? nullSafeVersion;
}
// Default to 2.12
return nullSafeVersion;