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.
This commit is contained in:
parent
0a13c12b1f
commit
284ec8a74f
1 changed files with 3 additions and 0 deletions
|
@ -28,6 +28,9 @@ class PushNotificationStatus {
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatKey(key) {
|
function formatKey(key) {
|
||||||
|
if (!key) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const partLength = 4;
|
const partLength = 4;
|
||||||
const partCount = Math.ceil(key.length / partLength);
|
const partCount = Math.ceil(key.length / partLength);
|
||||||
let formattedKey = "";
|
let formattedKey = "";
|
||||||
|
|
Reference in a new issue