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

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 1055983003: guard against non-existant package directory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/context_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 2d16ea9d852964dafd5ac436d41faa1ae8d37e20..e010a3e505be57eb287ae80e43f1d874116fe46d 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -395,7 +395,15 @@ abstract class ContextManager {
for (JavaFile file in packagesDir.listFiles()) {
// Ensure symlinks in packages directory are canonicalized
// to prevent 'type X cannot be assigned to type X' warnings
- Resource res = resourceProvider.getResource(file.getCanonicalPath());
+ String path;
+ try {
+ path = file.getCanonicalPath();
+ } catch (e, s) {
+ // Ignore packages that do not exist
+ _instrumentationService.logException(e, s);
+ continue;
+ }
+ Resource res = resourceProvider.getResource(path);
Brian Wilkerson 2015/04/24 21:43:20 Consider moving the four lines after the try-catch
if (res is Folder) {
packageMap[file.getName()] = <Folder>[res];
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698