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

Unified Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1426943005: Fix null pointer (issue 24790) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 1b8b2e08ed194197c601a102211a295c64cc56ee..d1fa70ea49200cdd973812b80dc5867487013f32 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -1048,13 +1048,17 @@ class AnalysisContextImpl implements InternalAnalysisContext {
@override
bool isClientLibrary(Source librarySource) {
CacheEntry entry = _cache.get(librarySource);
- return _referencesDartHtml(librarySource) && entry.getValue(IS_LAUNCHABLE);
+ return entry != null &&
+ _referencesDartHtml(librarySource) &&
+ entry.getValue(IS_LAUNCHABLE);
}
@override
bool isServerLibrary(Source librarySource) {
CacheEntry entry = _cache.get(librarySource);
- return !_referencesDartHtml(librarySource) && entry.getValue(IS_LAUNCHABLE);
+ return entry != null &&
+ !_referencesDartHtml(librarySource) &&
+ entry.getValue(IS_LAUNCHABLE);
}
@override
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698