From 8b79d35a70cceb545fde5dd9e01357edbd0a8956 Mon Sep 17 00:00:00 2001 From: BishyanKar Date: Thu, 28 Oct 2021 16:06:04 +0530 Subject: [PATCH] Fixes #2271 crash on closing WaveGenerator Screen --- app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java b/app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java index c3347df3b..3f492a731 100644 --- a/app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java +++ b/app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java @@ -1370,7 +1370,8 @@ protected void onCancelled() { @Override public void onBackPressed() { super.onBackPressed(); - produceSoundTask.cancel(true); + if(produceSoundTask != null) + produceSoundTask.cancel(true); produceSoundTask = null; isPlayingSound = false; }