[flutter_tools] make expando on vm service null safe to handle web stuff (#59624)
This commit is contained in:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user