Skip to content

Commit

Permalink
Return null if configs fail to load
Browse files Browse the repository at this point in the history
  • Loading branch information
virustotalop committed Mar 21, 2020
1 parent 3a68260 commit 9a69709
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/clubobsidian/wrappy/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@ public static Configuration load(URL url, File tempFile, File backupFile, int co
{
e.printStackTrace();
}

if(backupFile.exists())
{
return Configuration.load(backupFile);
}

return new Configuration();
else
{
return null;
}
}

public static Configuration load(InputStream stream, ConfigurationType type)
Expand Down Expand Up @@ -240,6 +243,7 @@ else if(type == ConfigurationType.XML)
catch(IOException ex)
{
ex.printStackTrace();
return null;
}
finally
{
Expand Down

0 comments on commit 9a69709

Please sign in to comment.