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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java

Issue 244253009: Fix for issue 18273 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean-up Created 6 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
index e8052a636d9b0a95c12f323587a02e3d1fca0d95..8f53c9f4f3d81f975cf3ed62c0af27a337160071 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/context/AnalysisContextImpl.java
@@ -1756,7 +1756,14 @@ public class AnalysisContextImpl implements InternalAnalysisContext {
@Override
public TypeProvider getTypeProvider() throws AnalysisException {
Source coreSource = getSourceFactory().forUri(DartSdk.DART_CORE);
- return new TypeProviderImpl(computeLibraryElement(coreSource));
+ if (coreSource == null) {
+ throw new AnalysisException("Could not create a source for dart:core");
+ }
+ LibraryElement coreElement = computeLibraryElement(coreSource);
+ if (coreElement == null) {
+ throw new AnalysisException("Could not create an element for dart:core");
+ }
+ return new TypeProviderImpl(coreElement);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698