Prevent NPE in recent clan chats when var is null
RECENT_CLAN_CHAT can be null when reset, so move the jagex name sanitization to updateRecentChat method (after null check). Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user