Validate empty observatory URI for screenshot (#71451)

This commit is contained in:
Jenn Magder
2020-12-01 10:00:30 -08:00
committed by GitHub
parent a5ee7f7cfc
commit 8522ec7e11
2 changed files with 15 additions and 2 deletions

View File

@@ -77,6 +77,9 @@ class ScreenshotCommand extends FlutterCommand {
if (observatoryUri == null) {
throwToolExit('Observatory URI must be specified for screenshot type $screenshotType');
}
if (observatoryUri.isEmpty || Uri.tryParse(observatoryUri) == null) {
throwToolExit('Observatory URI "$observatoryUri" is invalid');
}
}
}