diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/utils')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/UIHelper.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/UIHelper.java b/src/main/java/de/pixart/messenger/utils/UIHelper.java index 92efe4d26..13a08aedd 100644 --- a/src/main/java/de/pixart/messenger/utils/UIHelper.java +++ b/src/main/java/de/pixart/messenger/utils/UIHelper.java @@ -419,12 +419,14 @@ public class UIHelper { public static String concatNames(List<MucOptions.User> users, int max) { StringBuilder builder = new StringBuilder(); final boolean shortNames = users.size() >= 3; - for (int i = 0; i < Math.max(users.size(), max); ++i) { + for (int i = 0; i < Math.min(users.size(), max); ++i) { if (builder.length() != 0) { builder.append(", "); } final String name = UIHelper.getDisplayName(users.get(i)); - builder.append(shortNames ? name.split("\\s+")[0] : name); + if (name != null) { + builder.append(shortNames ? name.split("\\s+")[0] : name); + } } return builder.toString(); } |