mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 02:37:53 +00:00
Add more data to debug no elements in libraryUnit.units
Change-Id: I66c1283924a9003069cfcd9625cb965cb131188c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201380 Reviewed-by: Keerti Parthasarathy <keertip@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
4dea737439
commit
9aa7e922f2
|
@ -447,8 +447,16 @@ class FileResolver {
|
|||
completionPath: path,
|
||||
performance: performance,
|
||||
);
|
||||
var result =
|
||||
libraryUnit.units!.firstWhere((element) => element.path == path);
|
||||
var result = libraryUnit.units!
|
||||
.firstWhereOrNull((element) => element.path == path);
|
||||
// TODO(scheglov) Fix and remove.
|
||||
if (result == null) {
|
||||
throw StateError('''
|
||||
libraryFile.path: ${libraryFile.path}
|
||||
path: $path
|
||||
units: ${libraryUnit.units!.map((e) => '(${e.uri} = ${e.path})').toList()}
|
||||
''');
|
||||
}
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue