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 20221edea965c18481e54b97d2b60ceb50bb1cea
Author: Ian Springer <ian.springer(a)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)
(cherry picked from commit 55a89fae4b11ca5a8fecb668b87dbcef2bc04cf9)
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 e1244ae..f3363aa 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
@@ -98,8 +98,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;