Unverified Commit 01953a10 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tool] fix NPE in log reader for web server device (#46729)

parent 78951b0c
...@@ -218,7 +218,7 @@ class WebServerDevice extends Device { ...@@ -218,7 +218,7 @@ class WebServerDevice extends Device {
@override @override
DeviceLogReader getLogReader({ApplicationPackage app}) { DeviceLogReader getLogReader({ApplicationPackage app}) {
return _logReader ??= NoOpDeviceLogReader(app.name); return _logReader ??= NoOpDeviceLogReader(app?.name);
} }
@override @override
......
...@@ -58,6 +58,7 @@ void main() { ...@@ -58,6 +58,7 @@ void main() {
expect(device.supportsScreenshot, false); expect(device.supportsScreenshot, false);
expect(await device.isLocalEmulator, false); expect(await device.isLocalEmulator, false);
expect(device.getLogReader(app: mockWebApplicationPackage), isInstanceOf<NoOpDeviceLogReader>()); expect(device.getLogReader(app: mockWebApplicationPackage), isInstanceOf<NoOpDeviceLogReader>());
expect(device.getLogReader(), isInstanceOf<NoOpDeviceLogReader>());
expect(await device.portForwarder.forward(1), 1); expect(await device.portForwarder.forward(1), 1);
}); });
......
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