[flutter_tools] Fallback discovery: Don't crash when an Isolate has no root library (#52354)

This commit is contained in:
Zachary Anderson
2020-03-10 15:31:02 -07:00
committed by GitHub
parent d19c44344b
commit 53dce17b35
2 changed files with 26 additions and 1 deletions

View File

@@ -167,7 +167,7 @@ class FallbackDiscovery {
throw Exception('Expected Isolate but found Sentinel: $isolateResponse');
}
final LibraryRef library = (isolateResponse as Isolate).rootLib;
if (library.uri.startsWith('package:$packageName')) {
if (library != null && library.uri.startsWith('package:$packageName')) {
UsageEvent(
_kEventName,
'success',