1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

Handle null in utils

This commit is contained in:
Matt Gibson
2022-08-31 16:03:04 -04:00
parent ee6258bd3d
commit 1fb6207e53
2 changed files with 9 additions and 0 deletions

View File

@@ -97,6 +97,9 @@ export class Utils {
}
static fromByteStringToArray(str: string): Uint8Array {
if (str == null) {
return null;
}
const arr = new Uint8Array(str.length);
for (let i = 0; i < str.length; i++) {
arr[i] = str.charCodeAt(i);