From 5cc8def8e47b0a1cc71a03ba317d873334294c1b Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Tue, 25 Apr 2017 14:32:50 +0300 Subject: [PATCH] Fix broken _onAndroidAnimationEnd after back navigation --- tns-core-modules/ui/animation/animation.android.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tns-core-modules/ui/animation/animation.android.ts b/tns-core-modules/ui/animation/animation.android.ts index 13c55e9dd..f122896ad 100644 --- a/tns-core-modules/ui/animation/animation.android.ts +++ b/tns-core-modules/ui/animation/animation.android.ts @@ -113,13 +113,19 @@ export class Animation extends AnimationBase { if (traceEnabled()) { traceWrite("MainAnimatorListener.onAnimationEnd(" + animator + ")", traceCategories.Animation); } - that.get()._onAndroidAnimationEnd(); + const thisRef = that.get(); + if (thisRef) { + thisRef._onAndroidAnimationEnd(); + } }, onAnimationCancel: function (animator: android.animation.Animator): void { if (traceEnabled()) { traceWrite("MainAnimatorListener.onAnimationCancel(" + animator + ")", traceCategories.Animation); } - that.get()._onAndroidAnimationCancel(); + const thisRef = that.get(); + if (thisRef) { + thisRef._onAndroidAnimationCancel(); + } } }); }