Skip to content

Commit

Permalink
Make PhysicsEngine more resilient for invalid collision types
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen-wilke committed Dec 7, 2024
1 parent b8e5cab commit 8a1d22b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void add(final ICollisionEntity entity) {
* @param entity The entity that is about to be removed.
*/
public void remove(final ICollisionEntity entity) {
if (entity.getCollisionType() == null) {
if (entity.getCollisionType() == null || !collisionEntities.containsKey(entity.getCollisionType())) {
return;
}

Expand Down

0 comments on commit 8a1d22b

Please sign in to comment.