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

This commit is contained in:
Jonah Williams
2019-12-10 16:14:48 -08:00
committed by GitHub
parent 78951b0c01
commit 01953a1015
2 changed files with 2 additions and 1 deletions

View File

@@ -218,7 +218,7 @@ class WebServerDevice extends Device {
@override
DeviceLogReader getLogReader({ApplicationPackage app}) {
return _logReader ??= NoOpDeviceLogReader(app.name);
return _logReader ??= NoOpDeviceLogReader(app?.name);
}
@override

View File

@@ -58,6 +58,7 @@ void main() {
expect(device.supportsScreenshot, false);
expect(await device.isLocalEmulator, false);
expect(device.getLogReader(app: mockWebApplicationPackage), isInstanceOf<NoOpDeviceLogReader>());
expect(device.getLogReader(), isInstanceOf<NoOpDeviceLogReader>());
expect(await device.portForwarder.forward(1), 1);
});