From 37ce311764082d48423b5a747de4b492beaeecf5 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 8 Apr 2021 10:53:01 +0200 Subject: [PATCH] do not attempt to play ringtone if none was found --- .../eu/siacs/conversations/services/NotificationService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 1d01b0bd9..a4eec7fb1 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -425,6 +425,10 @@ public class NotificationService { } final Uri uri = Uri.parse(ringtonePreference); this.currentlyPlayingRingtone = RingtoneManager.getRingtone(mXmppConnectionService, uri); + if (this.currentlyPlayingRingtone == null) { + Log.d(Config.LOGTAG,"unable to find ringtone for uri "+uri); + return; + } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { this.currentlyPlayingRingtone.setLooping(true); }