From c37f6a66b4873f0d880affb3bf1bef8e73a6039a Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Tue, 2 Mar 2021 09:27:49 -0500 Subject: [PATCH] Safely handle sound settings --- phone/src/os/sound/utils/getSoundSettings.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phone/src/os/sound/utils/getSoundSettings.ts b/phone/src/os/sound/utils/getSoundSettings.ts index 05cd918..6a4a762 100644 --- a/phone/src/os/sound/utils/getSoundSettings.ts +++ b/phone/src/os/sound/utils/getSoundSettings.ts @@ -20,8 +20,9 @@ export const getSoundSettings = ( try { return app ? { - sound: getPath[type](settings[`${app}_${type}`]), - volume: settings[`${app}_${type}Vol`] / 100, + sound: getPath[type](settings[`${app}_${type}`] || settings[type]), + volume: + (settings[`${app}_${type}Vol`] || settings[`${type}Vol`]) / 100, } : { sound: getPath[type](settings[type]),