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) {
|
protected static Properties parseStringArgs(String[] args) {
|
||||||
File configFile = null;
|
File configFile = null;
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
|
|
||||||
|
if (args == null || args.length == 0) {
|
||||||
|
return props; // Empty properties
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<args.length; i++) {
|
for (int i=0; i<args.length; i++) {
|
||||||
String arg = args[i];
|
String arg = args[i];
|
||||||
if (arg.startsWith("-D") || arg.startsWith("-d")) {
|
if (arg.startsWith("-D") || arg.startsWith("-d")) {
|
||||||
|
@ -253,7 +258,9 @@ public abstract class AbstractJmsClientSystem extends AbstractObjectProperties {
|
||||||
|
|
||||||
Properties fileProps = new Properties();
|
Properties fileProps = new Properties();
|
||||||
try {
|
try {
|
||||||
|
if (configFile != null) {
|
||||||
fileProps.load(new FileInputStream(configFile));
|
fileProps.load(new FileInputStream(configFile));
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue