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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/PackageUriResolver.java

Issue 26293003: Check for null, when packages dir has no parent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « no previous file | pkg/analyzer_experimental/lib/src/generated/source_io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/PackageUriResolver.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/PackageUriResolver.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/PackageUriResolver.java
index 903b2316d1f1e07aca54d330f9b243add6d322c5..0525dede0d15096af9f19e3a12ad7f44d090764c 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/PackageUriResolver.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/PackageUriResolver.java
@@ -173,6 +173,9 @@ public class PackageUriResolver extends UriResolver {
*/
private boolean isSelfReference(File packagesDir, File file) {
File rootDir = packagesDir.getParentFile();
+ if (rootDir == null) {
+ return false;
+ }
String rootPath = rootDir.getAbsolutePath();
String filePath = file.getAbsolutePath();
return filePath.startsWith(rootPath + "/lib");
« no previous file with comments | « no previous file | pkg/analyzer_experimental/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698