mirror of
https://github.com/romancm/gamebrary
synced 2025-03-07 16:17:22 +00:00
null check
This commit is contained in:
parent
9e359a4bab
commit
d5be718398
1 changed files with 2 additions and 1 deletions
|
@ -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]));
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue