Index: lib/src/utils.dart |
diff --git a/lib/src/utils.dart b/lib/src/utils.dart |
index 4c7339520c673f724b77c967c1d74164a4615bbe..96166b0998e1e7293bde20fc0c3f7e1a34b89aac 100644 |
--- a/lib/src/utils.dart |
+++ b/lib/src/utils.dart |
@@ -207,8 +207,16 @@ _MemberTypeGetter _memberTypeGetter(ExecutableElement member) { |
return f; |
} |
-bool isDynamicTarget(Expression node) => |
- node != null && !isLibraryPrefix(node) && node.staticType.isDynamic; |
+bool isDynamicTarget(Expression node) { |
+ if (node == null) return false; |
+ |
+ if (isLibraryPrefix(node)) return false; |
+ |
+ // Null type happens when we have unknown identifiers, like a dart: import |
+ // that doesn't resolve. |
+ var type = node.staticType; |
+ return type == null || type.isDynamic; |
+} |
bool isLibraryPrefix(Expression node) => |
node is SimpleIdentifier && node.staticElement is PrefixElement; |