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 4a6b1f9fff3a5bc242b2be3ec54f0206cac89a70..eba635ff26ffc439c35e353eef55e1e949635319 100644 |
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart |
@@ -1096,7 +1096,7 @@ class FixProcessor { |
Source source = importDirective.source; |
if (source != null) { |
String file = source.fullName; |
- if (isAbsolute(file)) { |
+ if (isAbsolute(file) && AnalysisEngine.isDartFileName(file)) { |
String libName = _computeLibraryName(file); |
SourceEdit edit = new SourceEdit(0, 0, 'library $libName;$eol$eol'); |
doSourceChange_addSourceEdit(change, context, source, edit); |
@@ -2376,7 +2376,7 @@ class FixProcessor { |
if (relPathParts[0].toLowerCase() == 'lib') { |
relPathParts.removeAt(0); |
} |
- { |
+ if (relPathParts.isNotEmpty) { |
String nameWithoutExt = pathContext.withoutExtension(relPathParts.last); |
relPathParts[relPathParts.length - 1] = nameWithoutExt; |
} |