Commit a49fbb54 authored by Gergo Ujhelyi's avatar Gergo Ujhelyi
Browse files

fix null pointer when config file missing

parent 1466e6e0
......@@ -140,6 +140,11 @@ public class Cli extends UserInterface {
System.out.printf("Using configuration file: %s\n", config_file.getName());
final CfgAnalyzer cfgAnalyzer = new CfgAnalyzer();
if (config_file == null) {
System.out.println("Error was found in the configuration file. Exiting");
cleanUp();
return EXIT_FAILURE;
}
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