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:
Tomas Slusny
2018-03-15 16:46:22 +01:00
parent e85aca3c70
commit 709ecd5987

View File

@@ -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;
}