Commit a6aa0592 authored by Pony's avatar Pony

Added new list wrapper to avoid concurrent modification exceptions

parent 63fb29c3
......@@ -260,13 +260,14 @@ public class SpatialPositioningManager implements SpatialEventListener {
return null;
}
for (TangibleObject object : spatialMatrix.getHorizontal()) {
BaseWidget widget = TangibleObjectManager.getWidget(object.getObjectId());
if (widget.getClass().equals(_class)) {
return (T) widget;
synchronized (this) {
for (TangibleObject object : new ArrayList<>(spatialMatrix.getHorizontal())) {
BaseWidget widget = TangibleObjectManager.getWidget(object.getObjectId());
if (widget.getClass().equals(_class)) {
return (T) widget;
}
}
}
return null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment