Fix issue of synthetic import calling definingCompilationUnit on null
diff --git a/angular_analyzer_plugin/lib/src/facade/exports_import_element.dart b/angular_analyzer_plugin/lib/src/facade/exports_import_element.dart
index 7abb38e..cdca562 100644
--- a/angular_analyzer_plugin/lib/src/facade/exports_import_element.dart
+++ b/angular_analyzer_plugin/lib/src/facade/exports_import_element.dart
@@ -129,8 +129,9 @@
   List<NamespaceCombinator> get combinators => _wrappedImport.combinators;
 
   @override
-  LibraryElement get importedLibrary =>
-      new ExportsLibraryFacade(_wrappedImport.importedLibrary, _component,
+  LibraryElement get importedLibrary => _wrappedImport.importedLibrary == null
+      ? null
+      : new ExportsLibraryFacade(_wrappedImport.importedLibrary, _component,
           prefix: prefix?.name);
 
   @override
diff --git a/angular_analyzer_plugin/test/resolver_test.dart b/angular_analyzer_plugin/test/resolver_test.dart
index 4fb2660..cf49130 100644
--- a/angular_analyzer_plugin/test/resolver_test.dart
+++ b/angular_analyzer_plugin/test/resolver_test.dart
@@ -4789,6 +4789,24 @@
     ]);
   }
 
+  // ignore: non_constant_identifier_names
+  Future test_resolveTemplate_resolvingBogusImportDoesntCrash() async {
+    _addDartSource(r'''
+import ; // synthetic import
+@Component(selector: 'test-panel')
+@View(templateUrl: 'test_panel.html')
+class TestPanel {
+}
+''');
+    final code = '{{pants}}';
+    _addHtmlSource(code);
+    await _resolveSingleTemplate(dartSource);
+    expect(ranges, hasLength(0));
+    errorListener.assertErrorsWithCodes([
+      StaticWarningCode.UNDEFINED_IDENTIFIER,
+    ]);
+  }
+
   void _addDartSource(final code) {
     dartCode = '''
 import 'package:angular2/angular2.dart';