HashMap is not thread safe.  The existing synchronzed(map) is too small, should be extended to cover the surrounding code.
@@ -112,10 +112,11 @@ public class ArrowBuilder {
* Removes all arrows from the screen.
*/
public void removeAllArrows(UUID gameId) {
+ synchronized (map) {
if (map.containsKey(gameId)) {
Map<Type, List<Arrow>> innerMap = map.get(gameId);
JPanel p = getArrowsPanel(gameId);
- synchronized (map) {
+
if (p != null && p.getComponentCount() > 0) {
p.removeAll();
p.revalidate();
