Skip to content

Commit

Permalink
Return false when custom entity id is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Aug 13, 2024
1 parent 63dd60a commit d9a8fa4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public boolean isEntity(Entity entity) {
return false;
}

return entityId == CustomEntity.valueOf(entity.getPersistentDataContainer().get(plugin.getCustomEntityIdKey(), PersistentDataType.STRING));
try {
return entityId == CustomEntity.valueOf(entity.getPersistentDataContainer().get(plugin.getCustomEntityIdKey(), PersistentDataType.STRING));
} catch (IllegalArgumentException | NullPointerException exception) {
return false;
}
}
}

0 comments on commit d9a8fa4

Please sign in to comment.