[FlutterDriver] minor nullability fixes (#94584)

This commit is contained in:
Yegor 2021-12-03 16:40:57 -08:00 committed by GitHub
parent 5ddc00cc03
commit 4e2c77d491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -366,11 +366,12 @@ class FlutterDriverExtension with DeserializeFinderFactory, CreateFinderFactory,
final Command command = deserializeCommand(params, this);
assert(WidgetsBinding.instance!.isRootWidgetAttached || !command.requiresRootWidgetAttached,
'No root widget is attached; have you remembered to call runApp()?');
Future<Result?> responseFuture = handleCommand(command, _prober, this);
if (command.timeout != null)
responseFuture = responseFuture.timeout(command.timeout ?? Duration.zero);
final Result? response = await responseFuture;
return _makeResponse(response?.toJson());
Future<Result> responseFuture = handleCommand(command, _prober, this);
if (command.timeout != null) {
responseFuture = responseFuture.timeout(command.timeout!);
}
final Result response = await responseFuture;
return _makeResponse(response.toJson());
} on TimeoutException catch (error, stackTrace) {
final String message = 'Timeout while executing $commandKind: $error\n$stackTrace';
_log(message);