mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[flutter_tools] attempt to fix .first crasher in web loading (#52301)
This commit is contained in:
parent
2133343a29
commit
fdb7bd3c0f
@ -234,6 +234,9 @@ class ChromeLauncher {
|
||||
final HttpClientRequest request = await client.getUrl(base.resolve('/json/list'));
|
||||
final HttpClientResponse response = await request.close();
|
||||
final List<dynamic> jsonObject = await json.fuse(utf8).decoder.bind(response).single as List<dynamic>;
|
||||
if (jsonObject == null || jsonObject.isEmpty) {
|
||||
return base;
|
||||
}
|
||||
return base.resolve(jsonObject.first['devtoolsFrontendUrl'] as String);
|
||||
} on Exception {
|
||||
// If we fail to talk to the remote debugger protocol, give up and return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user