Unverified Commit faa7d459 authored by Lenard Nagy's avatar Lenard Nagy Committed by GitHub
Browse files

Merge pull request #617 from GergoUjhelyi/master

fix null pointer when config file missing
parents 330cff3f 311bd31c
......@@ -137,9 +137,15 @@ public class Cli extends UserInterface {
if (args.length == 1) {
config_file = new File(args[0]);
if (config_file == null) {
System.out.println("Error was found in the configuration file. Exiting");
cleanUp();
return EXIT_FAILURE;
}
System.out.printf("Using configuration file: %s\n", config_file.getName());
final CfgAnalyzer cfgAnalyzer = new CfgAnalyzer();
final boolean config_file_failure = cfgAnalyzer.parse(config_file);
if (config_file_failure) {
System.out.println("Error was found in the configuration file. Exiting");
......
......@@ -140,6 +140,9 @@ public class ConfigData {
//Package-private
static String getConfigFileContent(File config_file) {
if (config_file == null) {
return "";
}
StringBuilder contentBuilder = new StringBuilder();
BufferedReader br = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment