diff --git a/src/components/name-tag.js b/src/components/name-tag.js index ba457ce5b3..bbaf2d6f55 100644 --- a/src/components/name-tag.js +++ b/src/components/name-tag.js @@ -250,7 +250,7 @@ AFRAME.registerComponent("name-tag", { this.pronounsText.el.addEventListener("text-updated", () => this.updateNametagWidth(), { once: true }); - if (this.pronouns.length > DISPLAY_NAME_LENGTH) { + if (this.pronouns && this.pronouns.length > DISPLAY_NAME_LENGTH) { this.pronouns = this.pronouns.slice(0, DISPLAY_NAME_LENGTH).concat("..."); } this.pronounsText.el.setAttribute("text", { diff --git a/src/storage/store.js b/src/storage/store.js index 3078987fc0..852cbb3691 100644 --- a/src/storage/store.js +++ b/src/storage/store.js @@ -63,7 +63,7 @@ export const SCHEMA = { type: "object", additionalProperties: false, properties: { - displayName: { type: "string", pattern: "^[A-Za-z0-9_~ -]{3,32}$" }, + displayName: { type: "string", pattern: "^(?:[A-Z]|[a-z]|[0-9]|[_~\\-]|\\s){3,32}$" }, avatarId: { type: "string" }, pronouns: { type: "string", pattern: "^[a-zA-Z///a-zA-Z]{2,32}$" }, // personalAvatarId is obsolete, but we need it here for backwards compatibility.