From 5d11e321a89e14778a8dc09e72530465ce11f19d Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Sun, 16 Sep 2018 22:29:55 -0700 Subject: [PATCH] Fix setting global notification sound to 'None'. Fixes #8206 --- .../preferences/NotificationsPreferenceFragment.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/preferences/NotificationsPreferenceFragment.java b/src/org/thoughtcrime/securesms/preferences/NotificationsPreferenceFragment.java index fcf859d3e9..54ce541076 100644 --- a/src/org/thoughtcrime/securesms/preferences/NotificationsPreferenceFragment.java +++ b/src/org/thoughtcrime/securesms/preferences/NotificationsPreferenceFragment.java @@ -137,8 +137,9 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme NotificationChannels.updateMessageRingtone(getContext(), uri); TextSecurePreferences.removeNotificationRingtone(getContext()); } else { - NotificationChannels.updateMessageRingtone(getContext(), uri); - TextSecurePreferences.setNotificationRingtone(getContext(), uri != null ? uri.toString() : Uri.EMPTY.toString()); + uri = uri == null ? Uri.EMPTY : uri; + NotificationChannels.updateMessageRingtone(getContext(), uri ); + TextSecurePreferences.setNotificationRingtone(getContext(), uri.toString()); } initializeRingtoneSummary(findPreference(TextSecurePreferences.RINGTONE_PREF));