Skip to content
Snippets Groups Projects
Commit 209ad776 authored by Matyáš Latner's avatar Matyáš Latner
Browse files

#32 Fix of NPE in pursuit game

parent 7834ce38
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,9 @@ public class DragAndRotateActorListener extends InputListener {
if (activePointers.size() == 0) {
//if user removed all fingers before animation finished, piece is stopped and animated back to its original position
if (!isPieceAnimationDone()) {
pieceTranslationAction.interrupt();
if (pieceTranslationAction != null) {
pieceTranslationAction.interrupt();
}
Point pieceOriginalPosition = ((Grid) parentActor).getPieceGridPositionInPixels(((PuzzlePiece) draggedActor).getActualPosition());
parentActor.addAction(new RotateAndMovePieceInPosition((PuzzlePiece) draggedActor, actorOriginalRotation, pieceOriginalPosition, iOnRotationFinished));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment