Return if createNewFile throws an exception

This commit is contained in:
Warrior 2021-09-23 21:54:37 +02:00
parent 3b343b9a7f
commit 577ec718f1

View File

@ -32,13 +32,15 @@ public class WorldBlacklist {
blackListFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
return;
}
//Load up the blacklist
try (BufferedReader reader = new BufferedReader(new FileReader(blackListFile))) {
String currentLine;
while((currentLine = reader.readLine()) != null)
blacklist.add(currentLine.toLowerCase());
if (!currentLine.isEmpty())
blacklist.add(currentLine.toLowerCase());
} catch (IOException e) {
e.printStackTrace();