Merge pull request #893 from workadventure-xce/fix/first_login

Fix first login with empty local storage
This commit is contained in:
Kharhamel 2021-04-13 15:15:32 +02:00 committed by GitHub
commit 4bbfd4f12f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;