Skip to content

Commit 940426c

Browse files
committed
Update EntityPokemob.java
fixes a crash that can occur when despawning pokemobs on empty servers
1 parent 3849b9e commit 940426c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pokecube/java/pokecube/core/entity/pokemobs/EntityPokemob.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ && level() instanceof ServerLevel level)
344344
{
345345
Entity entity = level.getNearestPlayer(this, -1.0D);
346346
var notDefault = EventHooks.checkMobDespawn(this);
347-
if (notDefault)
347+
if (notDefault && entity != null)
348348
{
349349
double d0 = entity.distanceToSqr(this);
350350
if (this.removeWhenFarAway(d0))

0 commit comments

Comments
 (0)