[flutter_tool] fix NPE in daemon caused by returning null connection info from experimental web runner (#46909)

This commit is contained in:
Jonah Williams
2019-12-12 13:55:09 -08:00
committed by GitHub
parent 948e2b0101
commit 592a842b86
2 changed files with 5 additions and 2 deletions

View File

@@ -535,7 +535,7 @@ class _ExperimentalResidentWebRunner extends ResidentWebRunner {
_wipConnection = await chromeTab.connect();
}
appStartedCompleter?.complete();
connectionInfoCompleter?.complete();
connectionInfoCompleter?.complete(DebugConnectionInfo());
if (stayResident) {
await waitForAppToFinish();
} else {

View File

@@ -378,7 +378,10 @@ void main() {
unawaited(residentWebRunner.run(
connectionInfoCompleter: connectionInfoCompleter,
));
await connectionInfoCompleter.future;
final DebugConnectionInfo debugConnectionInfo = await connectionInfoCompleter.future;
expect(debugConnectionInfo, isNotNull);
final OperationResult result = await residentWebRunner.restart(fullRestart: false);
expect(testLogger.statusText, contains('Reloaded application in'));