Ensure selectedItem has a value

This commit is contained in:
Marcus Noble 2021-03-18 14:25:44 +00:00
parent 9f4e07d5a5
commit 9306e6cbe6
1 changed files with 1 additions and 1 deletions

View File

@ -424,7 +424,7 @@
.then(res => res.json())
.then(items => {
if (!this.showRead) {
if (!items.some(i => i.ID == this.selectedItem)) {
if (this.selectedItem && !items.some(i => i.ID == this.selectedItem)) {
items.unshift(this.items.find(i => i.ID == this.selectedItem));
}