Fix NPE in PlexCommand

This commit is contained in:
Allink 2022-07-24 01:08:54 +01:00 committed by Allink
parent 4a14f94158
commit 5f64e02cae
No known key found for this signature in database
GPG Key ID: 6C2F7CE6E0519E14

View File

@ -132,6 +132,11 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
{ {
PlexPlayer plexPlayer = plugin.getPlayerCache().getPlexPlayerMap().get(player.getUniqueId()); PlexPlayer plexPlayer = plugin.getPlayerCache().getPlexPlayerMap().get(player.getUniqueId());
if (plexPlayer == null)
{
return false;
}
if (plugin.getSystem().equalsIgnoreCase("ranks")) if (plugin.getSystem().equalsIgnoreCase("ranks"))
{ {
if (!plexPlayer.getRankFromString().isAtLeast(getLevel())) if (!plexPlayer.getRankFromString().isAtLeast(getLevel()))