From 5ad7d32bbfba6c1e0e3748a5173eedf189b630aa Mon Sep 17 00:00:00 2001 From: dtvv Date: Tue, 2 Oct 2018 08:54:38 -0500 Subject: [PATCH] Validate not null in onDestroy event for the media player --- .../cy/agorise/crystalwallet/activities/BoardActivity.java | 6 ++++-- .../cy/agorise/crystalwallet/activities/IntroActivity.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/BoardActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/BoardActivity.java index ee43bca..4a8a2de 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/BoardActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/BoardActivity.java @@ -284,8 +284,10 @@ public class BoardActivity extends CustomActivity { super.onDestroy(); //Release the media player - mediaPlayer.release(); - mediaPlayer = null; + if(mediaPlayer!=null){ + mediaPlayer.release(); + mediaPlayer = null; + } } public void loadUserImage(){ diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java index 17ec920..1d2d91f 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java @@ -161,8 +161,10 @@ public class IntroActivity extends CustomActivity { super.onDestroy(); //Release the media player - mediaPlayer.release(); - mediaPlayer = null; + if(mediaPlayer!=null){ + mediaPlayer.release(); + mediaPlayer = null; + } } @OnClick(R.id.btnImportAccount)