9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-30 04:19:28 +00:00

fix: throw error if file isn't created

This commit is contained in:
Craftinators
2023-02-27 12:57:12 -05:00
parent 97da4f7809
commit ef4d53eb85

View File

@@ -17,10 +17,12 @@ public class SQLiteData extends SQLData {
@Override
public void setup() {
File dataFolder = new File(HMCCosmeticsPlugin.getInstance().getDataFolder(), "database.db");
boolean exists = dataFolder.exists();
if (!dataFolder.exists()){
if (!exists) {
try {
dataFolder.createNewFile();
boolean created = dataFolder.createNewFile();
if (!created) throw new IOException("File didn't exist but now does");
} catch (IOException e) {
MessagesUtil.sendDebugMessages("File write error. Database will not work properly", Level.SEVERE);
}