Fix first login with empty local storage

During first login on a new domain the local storage is empty. This led
to a TypeError and hence blank black screen.
This commit is contained in:
PizZaKatZe 2021-04-13 01:41:26 +02:00
parent 8cdf572685
commit 5462af0dc7

View File

@ -14,8 +14,8 @@ export function isUserNameValid(value: string): boolean {
return regexp.test(value);
}
export function areCharacterLayersValid(value: string[]): boolean {
if (!value.length) return false;
export function areCharacterLayersValid(value: string[] | null): boolean {
if (!value || !value.length) return false;
for (let i = 0; i < value.length; i++) {
if (/^\w+$/.exec(value[i]) === null) {
return false;