Index: pkg/analyzer/lib/src/dart/analysis/file_state.dart |
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart |
index facf11f3a5912bfeab5009df057429bfb36ab812..1fdc870638459785ea05120fb8157f05c9144069 100644 |
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart |
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart |
@@ -492,7 +492,12 @@ class FileState { |
* Return the [FileState] for the given [relativeUri]. |
Brian Wilkerson
2017/01/31 21:51:23
Maybe mention that `null` is an expected result.
|
*/ |
FileState _fileForRelativeUri(String relativeUri) { |
- Uri absoluteUri = resolveRelativeUri(uri, Uri.parse(relativeUri)); |
+ Uri absoluteUri; |
+ try { |
+ absoluteUri = resolveRelativeUri(uri, Uri.parse(relativeUri)); |
+ } on FormatException catch (e) { |
+ return null; |
+ } |
return _fsState.getFileForUri(absoluteUri); |
} |