From 577ec718f15527e0b438ed012fe016826560b469 Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Thu, 23 Sep 2021 21:54:37 +0200 Subject: [PATCH] Return if createNewFile throws an exception --- src/main/java/com/gmail/nossr50/config/WorldBlacklist.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/config/WorldBlacklist.java b/src/main/java/com/gmail/nossr50/config/WorldBlacklist.java index 35abec3d6..cf930d1e6 100644 --- a/src/main/java/com/gmail/nossr50/config/WorldBlacklist.java +++ b/src/main/java/com/gmail/nossr50/config/WorldBlacklist.java @@ -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();