mirror of
https://github.com/Lissy93/dashy.git
synced 2025-04-07 20:55:11 +02:00
🐛 Check items exist before itterating #415
This commit is contained in:
parent
b76b8eb620
commit
f25aa07d5f
@ -70,8 +70,10 @@ const store = new Vuex.Store({
|
||||
getItemById: (state, getters) => (id) => {
|
||||
let item;
|
||||
getters.sections.forEach(sec => {
|
||||
const foundItem = sec.items.find((itm) => itm.id === id);
|
||||
if (foundItem) item = foundItem;
|
||||
if (sec.items) {
|
||||
const foundItem = sec.items.find((itm) => itm.id === id);
|
||||
if (foundItem) item = foundItem;
|
||||
}
|
||||
});
|
||||
return item;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user