diff --git a/src/client/canvas.ts b/src/client/canvas.ts index afaa89f..8bcb12f 100644 --- a/src/client/canvas.ts +++ b/src/client/canvas.ts @@ -331,10 +331,12 @@ export class ViewCanvas { public setUser(user: IcyNetUser): void { this._user = user; - this._userInfo.innerText = user.username; - this._userInfo.classList.add('logged-in'); - this._userInfo.setAttribute('href', '/logout'); this.picker.setLoggedIn(user); + if (user) { + this._userInfo.innerText = user.username; + this._userInfo.classList.add('logged-in'); + this._userInfo.setAttribute('href', '/logout'); + } } private _updateURL = debounce(() => {