From f7f10cf93f87a7fee23c0fc9ab447114c271c737 Mon Sep 17 00:00:00 2001 From: Alexis Durgnat <alexis.durgnat@etu.hesge.ch> Date: Sun, 3 Feb 2019 16:10:50 +0100 Subject: [PATCH] Minor cleanup --- .../java/ch/hepia/ui/MainWindowController.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/ch/hepia/ui/MainWindowController.java b/src/main/java/ch/hepia/ui/MainWindowController.java index 318b7c1..7cd8f75 100644 --- a/src/main/java/ch/hepia/ui/MainWindowController.java +++ b/src/main/java/ch/hepia/ui/MainWindowController.java @@ -256,6 +256,7 @@ public class MainWindowController implements Initializable { /** * Create a new journey and broadcast it + * Set the journey label and the current journey * @param app App context * @param pnl Panel containing the journey information */ @@ -283,17 +284,19 @@ public class MainWindowController implements Initializable { if (command.length > 1) { Main.getContext().getUser().get().addIgnoredUser(new User(command[1])); drawMessage(command[1] + " bloqué.", - "/img/help.png", c); + AppConfig.HELP_MESSAGE_ICON, c); } break; case "ignoredlist": List<User> list = Main.getContext().getUser().get().getIgnoredUserList(); - StringBuilder buffer = new StringBuilder(list.get(0).getName()); - for (int i = 1; i < list.size(); i++){ - buffer.append(", ").append(list.get(i).getName()); + if (list.size() > 0) { + StringBuilder buffer = new StringBuilder(list.get(0).getName()); + for (int i = 1; i < list.size(); i++){ + buffer.append(", ").append(list.get(i).getName()); + } + drawMessage("Bloqués : " + buffer.toString(), + AppConfig.HELP_MESSAGE_ICON, c); } - drawMessage("Bloqués : " + buffer.toString(), - "/img/help.png", c); break; } } else { -- GitLab