Fix herbiboar plugin NPE on startup
Add null check for client.getMapRegions because during plugin startup when game is loading, they are null. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -327,7 +327,7 @@ public class Herbiboars extends Plugin
|
||||
|
||||
private boolean checkArea()
|
||||
{
|
||||
return Arrays.stream(client.getMapRegions())
|
||||
return client.getMapRegions() != null && Arrays.stream(client.getMapRegions())
|
||||
.filter(x -> Arrays.stream(HERBIBOAR_REGIONS).anyMatch(y -> y == x))
|
||||
.toArray().length > 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user