Skip to content

Commit ebdc08e

Browse files
committed
Exit on exception and check for null before using variable config.
Signed-off-by: Ville Ranta-aho <ville@ville-pekka.com>
1 parent 6517278 commit ebdc08e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

command/src/com/mirth/connect/cli/CommandLineInterface.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,15 @@ private void run(String[] args) {
172172
error("We could not find the file: " + line.getOptionValue("c"), null);
173173
System.exit(2);
174174
}
175+
error("Loading configuration failed.", null);
176+
System.exit(2);
177+
}
178+
if (config != null) {
179+
String server = line.getOptionValue("a", config.getString("address"));
180+
String user = line.getOptionValue("u", config.getString("user"));
181+
String password = line.getOptionValue("p", config.getString("password"));
182+
String script = line.getOptionValue("s", config.getString("script"));
175183
}
176-
177-
String server = line.getOptionValue("a", config.getString("address"));
178-
String user = line.getOptionValue("u", config.getString("user"));
179-
String password = line.getOptionValue("p", config.getString("password"));
180-
String script = line.getOptionValue("s", config.getString("script"));
181-
182184
if ((server != null) && (user != null) && (password != null)) {
183185
runShell(server, user, password, script, line.hasOption("d"));
184186
} else {

0 commit comments

Comments
 (0)