Skip to content

Commit de618fa

Browse files
authored
Fix an error during embedded compiler shutdown (#2092)
1 parent 873e91e commit de618fa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/src/embedded/dispatcher.dart

+6
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ final class Dispatcher {
266266
_send(message);
267267

268268
var packet = _mailbox.take();
269+
if (packet.isEmpty) {
270+
// Compiler is shutting down, throw without calling `_handleError` as we
271+
// don't want to report this as an actual error.
272+
_requestError = true;
273+
throw StateError('Compiler is shutting down.');
274+
}
269275

270276
try {
271277
var messageBuffer =

0 commit comments

Comments
 (0)