Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect service restoration against SentinelException #6451

Merged
merged 4 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ DevTools extension for your pub package, see the getting started guide for
* Fixed theming bug in isolate selector - [#6403](https://github.com/flutter/devtools/pull/6403)
* Show the hot reload button for Dart server apps that support hot reload -
[#6341](https://github.com/flutter/devtools/pull/6341)
* Fixed exceptions on hot restart - [#6451](https://github.com/flutter/devtools/pull/6451)

## Inspector updates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,15 @@ final class ServiceExtensionManager with DisposerMixin {
// extension. This will restore extension states on the device after a hot
// restart. [_enabledServiceExtensions] will be empty on page refresh or
// initial start.
return await _callServiceExtension(
name,
_enabledServiceExtensions[name]!.value,
);
try {
return await _callServiceExtension(
name,
_enabledServiceExtensions[name]!.value,
);
} on SentinelException catch (_) {
// Service extension stopped existing while calling, so do nothing.
// This typically happens during hot restarts.
}
} else {
// Set any extensions that are already enabled on the device. This will
// enable extension states in DevTools on page refresh or initial start.
Expand Down