diff options
Diffstat (limited to 'static/pages')
| -rw-r--r-- | static/pages/settings/index.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/static/pages/settings/index.js b/static/pages/settings/index.js index cc985a5..36c1d09 100644 --- a/static/pages/settings/index.js +++ b/static/pages/settings/index.js @@ -87,11 +87,13 @@ export default class SettingsView extends sfw.element.Container { set profile(profile) { this.#profile = profile; - this.#profile_image.src = `/api/profile/image/load/${profile.name}`; - this.#profile_image.onerror = () => this.#profile_image.removeAttribute('src'); + if (this.#profile) { + this.#profile_image.src = `/api/profile/image/load/${profile.name}`; + this.#profile_image.onerror = () => this.#profile_image.removeAttribute('src'); - this.#name.value = profile.full_name; - this.#birthday.value = profile.birthday; + this.#name.value = profile.full_name; + this.#birthday.value = profile.birthday; + } } get profile() { |