[flutter_tool] Some additional input validation for 'version' (#39136)

This commit is contained in:
Zachary Anderson
2019-08-26 12:12:50 -07:00
committed by GitHub
parent 7f5540faac
commit e9bd2ef087
2 changed files with 14 additions and 0 deletions

View File

@@ -65,6 +65,10 @@ class VersionCommand extends FlutterCommand {
// check min supported version
final Version targetVersion = Version.parse(version);
if (targetVersion == null) {
throwToolExit('Failed to parse version "$version"');
}
bool withForce = false;
if (targetVersion < minSupportedVersion) {
if (!argResults['force']) {