Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
3f163d29
Unverified
Commit
3f163d29
authored
Feb 03, 2021
by
Jenn Magder
Committed by
GitHub
Feb 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return an empty FlutterViews list when the service disappears (#75301)
parent
9ae10d0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+4
-1
vmservice_test.dart
...ages/flutter_tools/test/general.shard/vmservice_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/vmservice.dart
View file @
3f163d29
...
@@ -779,7 +779,10 @@ extension FlutterVmService on vm_service.VmService {
...
@@ -779,7 +779,10 @@ extension FlutterVmService on vm_service.VmService {
kListViewsMethod
,
kListViewsMethod
,
);
);
if
(
response
==
null
)
{
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
<
Object
>
rawViews
=
response
.
json
[
'views'
]
as
List
<
Object
>;
final
List
<
FlutterView
>
views
=
<
FlutterView
>[
final
List
<
FlutterView
>
views
=
<
FlutterView
>[
...
...
packages/flutter_tools/test/general.shard/vmservice_test.dart
View file @
3f163d29
...
@@ -356,7 +356,7 @@ void main() {
...
@@ -356,7 +356,7 @@ void main() {
expect
(
skSLs
,
isNull
);
expect
(
skSLs
,
isNull
);
final
List
<
FlutterView
>
views
=
await
fakeVmServiceHost
.
vmService
.
getFlutterViews
();
final
List
<
FlutterView
>
views
=
await
fakeVmServiceHost
.
vmService
.
getFlutterViews
();
expect
(
views
,
is
Null
);
expect
(
views
,
is
Empty
);
final
vm_service
.
Response
screenshot
=
await
fakeVmServiceHost
.
vmService
.
screenshot
();
final
vm_service
.
Response
screenshot
=
await
fakeVmServiceHost
.
vmService
.
screenshot
();
expect
(
screenshot
,
isNull
);
expect
(
screenshot
,
isNull
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment