Unverified Commit 8f7b2f9b authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] throw StateError instead of null (#56481)

parent 85cd4819
...@@ -335,7 +335,7 @@ class FlutterWebPlatform extends PlatformPlugin { ...@@ -335,7 +335,7 @@ class FlutterWebPlatform extends PlatformPlugin {
Object message, Object message,
) async { ) async {
if (_closed) { if (_closed) {
return null; throw StateError('Load called on a closed FlutterWebPlatform');
} }
final PoolResource lockResource = await _suiteLock.request(); final PoolResource lockResource = await _suiteLock.request();
...@@ -348,7 +348,7 @@ class FlutterWebPlatform extends PlatformPlugin { ...@@ -348,7 +348,7 @@ class FlutterWebPlatform extends PlatformPlugin {
} }
if (_closed) { if (_closed) {
return null; throw StateError('Load called on a closed FlutterWebPlatform');
} }
final Uri suiteUrl = url.resolveUri(globals.fs.path.toUri(globals.fs.path.withoutExtension( final Uri suiteUrl = url.resolveUri(globals.fs.path.toUri(globals.fs.path.withoutExtension(
...@@ -360,7 +360,7 @@ class FlutterWebPlatform extends PlatformPlugin { ...@@ -360,7 +360,7 @@ class FlutterWebPlatform extends PlatformPlugin {
lockResource.release(); lockResource.release();
}); });
if (_closed) { if (_closed) {
return null; throw StateError('Load called on a closed FlutterWebPlatform');
} }
return suite; return suite;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment