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 { ...@@ -260,13 +260,14 @@ public class SpatialPositioningManager implements SpatialEventListener {
return null; return null;
} }
for (TangibleObject object : spatialMatrix.getHorizontal()) { synchronized (this) {
BaseWidget widget = TangibleObjectManager.getWidget(object.getObjectId()); for (TangibleObject object : new ArrayList<>(spatialMatrix.getHorizontal())) {
if (widget.getClass().equals(_class)) { BaseWidget widget = TangibleObjectManager.getWidget(object.getObjectId());
return (T) widget; if (widget.getClass().equals(_class)) {
return (T) widget;
}
} }
} }
return null; 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