Skip to content

Commit 01953a1

Browse files
author
Jonah Williams
authored
[flutter_tool] fix NPE in log reader for web server device (flutter#46729)
1 parent 78951b0 commit 01953a1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/flutter_tools/lib/src/web/web_device.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class WebServerDevice extends Device {
218218

219219
@override
220220
DeviceLogReader getLogReader({ApplicationPackage app}) {
221-
return _logReader ??= NoOpDeviceLogReader(app.name);
221+
return _logReader ??= NoOpDeviceLogReader(app?.name);
222222
}
223223

224224
@override

packages/flutter_tools/test/general.shard/web/devices_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ void main() {
5858
expect(device.supportsScreenshot, false);
5959
expect(await device.isLocalEmulator, false);
6060
expect(device.getLogReader(app: mockWebApplicationPackage), isInstanceOf<NoOpDeviceLogReader>());
61+
expect(device.getLogReader(), isInstanceOf<NoOpDeviceLogReader>());
6162
expect(await device.portForwarder.forward(1), 1);
6263
});
6364

0 commit comments

Comments
 (0)