diff --git a/src/react-components/avatar-preview.js b/src/react-components/avatar-preview.js index 368060e79c..d0c7cf7d97 100644 --- a/src/react-components/avatar-preview.js +++ b/src/react-components/avatar-preview.js @@ -207,10 +207,13 @@ class AvatarPreview extends Component { const newLoadId = ++this.loadId; const url = proxiedUrlFor(this.props.avatarGltfUrl); const gltf = await this.loadPreviewAvatar(url); - // If we had started loading another avatar while we were loading this one, throw this one away - if (!this.mounted || newLoadId !== this.loadId) return; - if (gltf && this.props.onGltfLoaded) this.props.onGltfLoaded(gltf); - this.setAvatar(gltf.scene); + + if (gltf) { + // If we had started loading another avatar while we were loading this one, throw this one away + if (!this.mounted || newLoadId !== this.loadId) return; + if (gltf && this.props.onGltfLoaded) this.props.onGltfLoaded(gltf); + this.setAvatar(gltf.scene); + } } applyMaps(oldProps, newProps) { diff --git a/src/react-components/room/AvatarUrlModal.js b/src/react-components/room/AvatarUrlModal.js index f6a7d66aa1..eb46e8197c 100644 --- a/src/react-components/room/AvatarUrlModal.js +++ b/src/react-components/room/AvatarUrlModal.js @@ -14,12 +14,11 @@ export function AvatarUrlModal({ onSubmit, onClose }) { }> } placeholder="https://example.com/avatar.glb" type="url" required - ref={register} + {...register("url")} description={