Unverified Commit 719ea5a8 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] make expando on vm service null safe to handle web stuff (#59624)

parent dbc6dca5
......@@ -444,9 +444,9 @@ class FlutterView {
/// Flutter specific VM Service functionality.
extension FlutterVmService on vm_service.VmService {
Uri get wsAddress => _wsAddressExpando[this];
Uri get wsAddress => this != null ? _wsAddressExpando[this] : null;
Uri get httpAddress => _httpAddressExpando[this];
Uri get httpAddress => this != null ? _httpAddressExpando[this] : null;
/// Set the asset directory for the an attached Flutter view.
Future<void> setAssetDirectory({
......
......@@ -395,6 +395,13 @@ void main() {
);
expect(fakeVmServiceHost.hasRemainingExpectations, false);
});
testWithoutContext('expandos are null safe', () {
vm_service.VmService vmService;
expect(vmService.httpAddress, null);
expect(vmService.wsAddress, null);
});
}
class MockDevice extends Mock implements Device {}
......
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