mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Return an empty FlutterViews list when the service disappears (#75301)
This commit is contained in:
parent
9ae10d0fd2
commit
3f163d29a4
@ -779,7 +779,10 @@ extension FlutterVmService on vm_service.VmService {
|
||||
kListViewsMethod,
|
||||
);
|
||||
if (response == null) {
|
||||
return null;
|
||||
// The service may have disappeared mid-request.
|
||||
// Return an empty list now, and let the shutdown logic elsewhere deal
|
||||
// with cleaning up.
|
||||
return <FlutterView>[];
|
||||
}
|
||||
final List<Object> rawViews = response.json['views'] as List<Object>;
|
||||
final List<FlutterView> views = <FlutterView>[
|
||||
|
@ -356,7 +356,7 @@ void main() {
|
||||
expect(skSLs, isNull);
|
||||
|
||||
final List<FlutterView> views = await fakeVmServiceHost.vmService.getFlutterViews();
|
||||
expect(views, isNull);
|
||||
expect(views, isEmpty);
|
||||
|
||||
final vm_service.Response screenshot = await fakeVmServiceHost.vmService.screenshot();
|
||||
expect(screenshot, isNull);
|
||||
|
Loading…
Reference in New Issue
Block a user