Skip to content

Commit ae5534a

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Handle cases where a non-dart file is being edited (issue 32160)
Change-Id: Icd7d1ff0ecb4515163281c9a85a1b1927e864fbe Reviewed-on: https://dart-review.googlesource.com/41400 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 577fc04 commit ae5534a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DartChangeBuilderImpl extends ChangeBuilderImpl
5050
@override
5151
Future<DartFileEditBuilderImpl> createFileEditBuilder(String path) async {
5252
ResolveResult result = await session.getResolvedAst(path);
53-
ResultState state = result.state;
53+
ResultState state = result?.state ?? ResultState.INVALID_FILE_TYPE;
5454
if (state == ResultState.INVALID_FILE_TYPE) {
5555
throw new AnalysisException('Cannot analyze "$path"');
5656
}

0 commit comments

Comments
 (0)