null check

This commit is contained in:
Gamebrary 2020-11-03 15:12:29 -07:00
parent 9e359a4bab
commit d5be718398

View file

@ -102,7 +102,8 @@ export default {
const { id } = this.game;
this.localNote = typeof this.notes[id] === 'object' && this.notes[id].text
// TODO: use optional chaining
this.localNote = this.notes[id] && typeof this.notes[id] === 'object' && this.notes[id].text
? this.notes[id].text
: JSON.parse(JSON.stringify(this.notes[id]));
},