From f7077316b1856145507f175aaabe115b7cdabaee Mon Sep 17 00:00:00 2001 From: "Josh (Vicarious)" Date: Mon, 24 Aug 2020 22:52:06 -0700 Subject: [PATCH] Set default instead of null check --- .../draycia/carbon/commands/ChannelListCommand.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/draycia/carbon/commands/ChannelListCommand.java b/src/main/java/net/draycia/carbon/commands/ChannelListCommand.java index 190ae79b..735fb72e 100644 --- a/src/main/java/net/draycia/carbon/commands/ChannelListCommand.java +++ b/src/main/java/net/draycia/carbon/commands/ChannelListCommand.java @@ -86,13 +86,9 @@ public class ChannelListCommand extends BaseCommand { } private void makeList(Iterator iterator, TextComponent.Builder list) { - String listSeparator = carbonChat.getLanguage().getString("channel-list-separator"); - Component listSeparatorComponent; - if (listSeparator != null) { - listSeparatorComponent = TextComponent.of(listSeparator); - } else { - listSeparatorComponent = TextComponent.of(", "); - } + String listSeparator = carbonChat.getLanguage().getString("channel-list-separator", ", "); + Component listSeparatorComponent = listSeparatorComponent = TextComponent.of(listSeparator); + while (iterator.hasNext()) { ChatChannel channel = iterator.next(); list.append(TextComponent.of(channel.getName()));