Index: pkg/analyzer/lib/src/generated/error_verifier.dart |
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart |
index 0a54caa945d7caa6d04eff3b93240b1e30095c02..423a58a5ba58d1c3f84ee30af33470959f676b18 100644 |
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart |
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart |
@@ -4394,7 +4394,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> { |
void _checkForMissingJSLibAnnotation(Annotation node) { |
if (node.elementAnnotation?.isJS ?? false) { |
Element element = ElementLocator.locate(node.parent); |
- if (element?.library?.isJS != true) { |
+ if (element != null && element.library?.isJS != true) { |
pquitslund
2016/07/29 18:05:25
Should this be triggered if the library is null?
Brian Wilkerson
2016/07/29 18:56:22
I have no idea. The library should never be null;
|
_errorReporter.reportErrorForNode( |
HintCode.MISSING_JS_LIB_ANNOTATION, node, [element.name]); |
} |