diff --git a/public/index.html b/public/index.html index 37409a7..a8fcc64 100644 --- a/public/index.html +++ b/public/index.html @@ -18,6 +18,34 @@ + + + + + diff --git a/src/Place.ts b/src/Place.ts index 6dc5370..90a81ff 100644 --- a/src/Place.ts +++ b/src/Place.ts @@ -21,9 +21,11 @@ export class Place extends LitElement { addSpell() { if (this.getCurrentSpell && typeof this.getCurrentSpell === 'function') { const spell = this.getCurrentSpell(); - this.spells.push(spell); - localStorage.setItem(this.location, JSON.stringify(this.spells)); - this.requestUpdate(); + if (spell) { + this.spells.push(spell); + localStorage.setItem(this.location, JSON.stringify(this.spells)); + this.requestUpdate(); + } } }