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:
Adrian T. Co 2006-07-03 05:09:17 +00:00
parent 7113c5efd8
commit 0d9c764bf5
1 changed files with 8 additions and 1 deletions

View File

@ -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();
}