mirror of https://github.com/apache/activemq.git
NPE checking
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@418683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7113c5efd8
commit
0d9c764bf5
|
@ -233,6 +233,11 @@ public abstract class AbstractJmsClientSystem extends AbstractObjectProperties {
|
|||
protected static Properties parseStringArgs(String[] args) {
|
||||
File configFile = null;
|
||||
Properties props = new Properties();
|
||||
|
||||
if (args == null || args.length == 0) {
|
||||
return props; // Empty properties
|
||||
}
|
||||
|
||||
for (int i=0; i<args.length; i++) {
|
||||
String arg = args[i];
|
||||
if (arg.startsWith("-D") || arg.startsWith("-d")) {
|
||||
|
@ -253,7 +258,9 @@ public abstract class AbstractJmsClientSystem extends AbstractObjectProperties {
|
|||
|
||||
Properties fileProps = new Properties();
|
||||
try {
|
||||
fileProps.load(new FileInputStream(configFile));
|
||||
if (configFile != null) {
|
||||
fileProps.load(new FileInputStream(configFile));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue