From 284ec8a74f6f515b3cb0a6597faca2fea22dc78d Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 31 Aug 2021 16:11:31 +0100 Subject: [PATCH] Check for null keys in settings view model The keys to format in the settings view model might be null. This avoid crashing the UI by testing for this case. --- src/domain/session/settings/SettingsViewModel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/domain/session/settings/SettingsViewModel.js b/src/domain/session/settings/SettingsViewModel.js index 7120f5fb..1f676bb3 100644 --- a/src/domain/session/settings/SettingsViewModel.js +++ b/src/domain/session/settings/SettingsViewModel.js @@ -28,6 +28,9 @@ class PushNotificationStatus { } function formatKey(key) { + if (!key) { + return null; + } const partLength = 4; const partCount = Math.ceil(key.length / partLength); let formattedKey = "";