Skip to content

Commit 49e3d7d

Browse files
authored
fix(CommandDialog, update): avoid oob access when command box is empty (#4)
1 parent 4cfa695 commit 49e3d7d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

bundles/org.vcml.explorer.ui/src/org/vcml/explorer/ui/dialogs/CommandDialog.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ private void execute() {
8383

8484
private void update() {
8585
String[] args = commandBoxInput.getText().split(" ");
86-
String name = args[0];
87-
command = module.findCommand(name);
86+
command = (args.length > 0) ? module.findCommand(args[0]) : null;
8887
execBtn.setEnabled(false);
8988
if (command == null) {
9089
commandBoxLabel.setText("invalid command '" + commandBoxInput.getText() + "'");

0 commit comments

Comments
 (0)