Index: pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
index e25e759af336bc0d06d96fb26618bb6ba8fe76ff..2d0ea14caa9e570295f4530521cd83e0a7a4591c 100644 |
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
@@ -809,10 +809,15 @@ class FixProcessor { |
if (library != null) { |
targetUnit = library.definingCompilationUnit; |
Source targetSource = targetUnit.source; |
- offset = targetSource.contents.data.length; |
- filePath = targetSource.fullName; |
- prefix = '$eol'; |
- suffix = '$eol'; |
+ try { |
+ offset = targetSource.contents.data.length; |
+ filePath = targetSource.fullName; |
+ prefix = '$eol'; |
+ suffix = '$eol'; |
+ } on FileSystemException { |
+ // If we can't read the file to get the offset, then we can't |
+ // create a fix. |
+ } |
break; |
} |
} |