From b645e4ea3c6d39f6ce274a334bcaa33817baa3ea Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Mon, 17 Apr 2017 15:21:12 -0700 Subject: [PATCH] [fuchsia_reload] Fix command line argument checking (#9434) --- .../flutter_tools/lib/src/commands/fuchsia_reload.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart b/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart index befbbaf566..3dcbf92c5b 100644 --- a/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart +++ b/packages/flutter_tools/lib/src/commands/fuchsia_reload.dart @@ -195,9 +195,12 @@ class FuchsiaReloadCommand extends FlutterCommand { return; } - final List gnTarget = _extractPathAndName(argResults['gn-target']); - _projectRoot = gnTarget[0]; - _projectName = gnTarget[1]; + final String gnTarget = argResults['gn-target']; + if (gnTarget == null) + throwToolExit('Give the GN target with --gn-target(-g).'); + final List targetInfo = _extractPathAndName(gnTarget); + _projectRoot = targetInfo[0]; + _projectName = targetInfo[1]; _fuchsiaProjectPath = '$_fuchsiaRoot/$_projectRoot'; if (!_directoryExists(_fuchsiaProjectPath)) throwToolExit('Target does not exist in the Fuchsia tree: $_fuchsiaProjectPath.');