Merge pull request #6156 from deathbeam/prevent-npe

Prevent NPE in recent clan chats when var is null
This commit is contained in:
Tomas Slusny
2018-10-24 12:21:33 +02:00
committed by GitHub

View File

@@ -133,7 +133,7 @@ public class ClanChatPlugin extends Plugin
{
if (strChanged.getIndex() == VarClientStr.RECENT_CLAN_CHAT.getIndex() && config.recentChats())
{
updateRecentChat(Text.toJagexName(client.getVar(VarClientStr.RECENT_CLAN_CHAT)));
updateRecentChat(client.getVar(VarClientStr.RECENT_CLAN_CHAT));
}
}
@@ -215,6 +215,8 @@ public class ClanChatPlugin extends Plugin
return;
}
s = Text.toJagexName(s);
chats.removeIf(s::equalsIgnoreCase);
chats.add(s);