Skip to content

Commit a276fe4

Browse files
committed
Fix #77 where attempt to remove a Component from an
already-reset PooledEntity would cause an IllegalArgumentException.
1 parent 963b754 commit a276fe4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ashley/src/com/badlogic/ashley/core/PooledEngine.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ private class PooledEntity extends Entity implements Poolable {
106106
@Override
107107
Component removeInternal(Class<? extends Component> componentType){
108108
Component component = super.removeInternal(componentType);
109-
componentPools.free(component);
109+
110+
if(component != null) {
111+
componentPools.free(component);
112+
}
113+
110114
return component;
111115
}
112116

0 commit comments

Comments
 (0)