Fix vuln reported by Sonar

This commit is contained in:
Rsl1122 2018-01-28 15:43:42 +02:00
parent bc17486fdb
commit 37b5e69cf3

View File

@ -10,6 +10,7 @@ import com.djrapitops.plugin.api.config.Config;
import com.djrapitops.plugin.api.utility.log.Log;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
@ -76,7 +77,9 @@ public class ThemeConfig extends Config {
}
File themeFile = new File(folder, "theme.yml");
if (!themeFile.exists()) {
themeFile.createNewFile();
if (!themeFile.createNewFile()) {
throw new FileNotFoundException("Failed to create theme.yml");
}
}
return themeFile;
}