modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit 55a89fae4b11ca5a8fecb668b87dbcef2bc04cf9 Author: Ian Springer ian.springer@redhat.com Date: Tue Jan 31 17:12:36 2012 -0500
[BZ 784678] prevent NPE from occurring if -f option is not passed to CLI record command - instead throw a command line parse exception with an informative error message (https://bugzilla.redhat.com/show_bug.cgi?id=784678)
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java index e38e81a..468076e 100644 --- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java +++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/RecordCommand.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2012 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -96,8 +96,12 @@ public class RecordCommand implements ClientCommand { code = getopt.getopt(); }
+ if (recordArgs.file == null) { + throw new CommandLineParseException("The file option must be specified."); + } + if (recordArgs.recordState == null) { - throw new CommandLineParseException("Either the start or stop option must be specified"); + throw new CommandLineParseException("Either the start or stop option must be specified."); }
return recordArgs;
rhq-commits@lists.fedorahosted.org