Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: pkg/analyzer/lib/src/generated/element_resolver.dart

Issue 2812673002: Add missing checks for null imported/exportedLibraries. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/element_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index b1c5283b5a4c3080907601f9387279002941f8a0..4dd9726bc298f6b63391f79bb44ea0682167d843 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -626,7 +626,8 @@ class ElementResolver extends SimpleAstVisitor<Object> {
[(target as SimpleIdentifier).name]);
}
LibraryElement importedLibrary = _getImportedLibrary(target);
- FunctionElement loadLibraryFunction = importedLibrary.loadLibraryFunction;
+ FunctionElement loadLibraryFunction =
+ importedLibrary?.loadLibraryFunction;
methodName.staticElement = loadLibraryFunction;
node.staticInvokeType = loadLibraryFunction.type;
return null;
@@ -894,7 +895,7 @@ class ElementResolver extends SimpleAstVisitor<Object> {
if (identifier.name == FunctionElement.LOAD_LIBRARY_NAME &&
_isDeferredPrefix(prefix)) {
LibraryElement importedLibrary = _getImportedLibrary(prefix);
- identifier.staticElement = importedLibrary.loadLibraryFunction;
+ identifier.staticElement = importedLibrary?.loadLibraryFunction;
return null;
}
//

Powered by Google App Engine
This is Rietveld 408576698