From 9bd7db80617635d6c824b1a476b5d3f55340fa2c Mon Sep 17 00:00:00 2001
From: vvashchenko <vitaliy.vashchenko@nic.cz>
Date: Wed, 30 Mar 2016 13:41:28 +0200
Subject: [PATCH] #280 ArrayIndexOutOfBoundsException fix

---
 .../tablexia/util/listener/DragAndRotateActorListener.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java b/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java
index 65363a9f3..959156c5b 100644
--- a/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java
+++ b/core/src/cz/nic/tablexia/util/listener/DragAndRotateActorListener.java
@@ -13,9 +13,9 @@ import cz.nic.tablexia.game.games.pursuit.action.RotateAndMovePieceInPosition;
 import cz.nic.tablexia.game.games.pursuit.action.RotatePieceToClosestAngle;
 import cz.nic.tablexia.game.games.pursuit.helper.ArithmeticsHelper;
 import cz.nic.tablexia.game.games.pursuit.model.Grid;
+import cz.nic.tablexia.game.games.pursuit.model.PuzzlePiece;
 import cz.nic.tablexia.util.Log;
 import cz.nic.tablexia.util.Point;
-import cz.nic.tablexia.game.games.pursuit.model.PuzzlePiece;
 
 /**
  * Created by Vaclav Tarantik on 6/18/15.
@@ -115,7 +115,7 @@ public class DragAndRotateActorListener extends InputListener {
     @Override
     public void touchUp(InputEvent event, final float x, final float y, int pointer, int button) {
         if (button != 1) {
-            if (draggedActor != null && !performingAction) {
+            if (draggedActor != null && !performingAction && activePointers.size()>=1) {
                 //storing original fingers positions and deciding which finger was released
                 boolean draggingFingerLifted = ((Integer) (activePointers.keySet().toArray()[0]) == pointer);
                 boolean rotatingFingerLifted = false;
-- 
GitLab