diff --git a/taptargetview/src/main/java/com/getkeepsafe/taptargetview/TapTargetSequence.java b/taptargetview/src/main/java/com/getkeepsafe/taptargetview/TapTargetSequence.java index 5267f30..ef64635 100644 --- a/taptargetview/src/main/java/com/getkeepsafe/taptargetview/TapTargetSequence.java +++ b/taptargetview/src/main/java/com/getkeepsafe/taptargetview/TapTargetSequence.java @@ -174,10 +174,7 @@ public void startAt(int index) { */ @UiThread public boolean cancel() { - if (targets.isEmpty() || !active) { - return false; - } - if (currentView == null || !currentView.cancelable) { + if (!active || currentView == null || !currentView.cancelable) { return false; } currentView.dismiss(false); @@ -198,6 +195,7 @@ void showNext() { currentView = TapTargetView.showFor(dialog, tapTarget, tapTargetListener); } } catch (NoSuchElementException e) { + currentView = null; // No more targets if (listener != null) { listener.onSequenceFinish();