Handle case where lastLogcatTimestamp is null (#45937)

This commit is contained in:
Emmanuel Garcia
2019-12-02 15:02:11 -08:00
committed by GitHub
parent c59151b1cd
commit 8c25328014
2 changed files with 25 additions and 1 deletions

View File

@@ -1009,7 +1009,13 @@ class _AdbLogReader extends DeviceLogReader {
void _start() {
final String lastTimestamp = device.lastLogcatTimestamp;
// Start the adb logcat process and filter the most recent logs since `lastTimestamp`.
final List<String> args = <String>['logcat', '-v', 'time', '-T', lastTimestamp];
final List<String> args = <String>[
'logcat',
'-v',
'time',
'-T',
lastTimestamp ?? '', // Empty `-T` means the timestamp of the logcat command invocation.
];
processUtils.start(device.adbCommandForDevice(args)).then<void>((Process process) {
_process = process;
// We expect logcat streams to occasionally contain invalid utf-8,