mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
Use a safe codec to read Skia SKP screenshot files when checking for errors (#14086)
If the downloaded file is an actual SKP and not an error report, then the default UTF-8 codec will fail to decode the SKP content
This commit is contained in:
parent
27eeb9722f
commit
e11cf5c94c
|
@ -89,7 +89,9 @@ class ScreenshotCommand extends FlutterCommand {
|
|||
await sink.close();
|
||||
await showOutputFileInfo(outputFile);
|
||||
if (await outputFile.length() < 1000) {
|
||||
final String content = await outputFile.readAsString();
|
||||
final String content = await outputFile.readAsString(
|
||||
encoding: const AsciiCodec(allowInvalid: true),
|
||||
);
|
||||
if (content.startsWith('{"jsonrpc":"2.0", "error"'))
|
||||
throwToolExit('\nIt appears the output file contains an error message, not valid skia output.');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue