Skip to content

Commit fb32d4f

Browse files
committed
fix(ui): prevent exception when no categories available
1 parent 72bd0b6 commit fb32d4f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ui/src/components/QIconPicker.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,16 @@ export default {
256256
},
257257

258258
__getCategories () {
259-
let t = []
259+
const t = []
260260
this.iconsList.forEach(icon => {
261261
const tags = icon.tags
262-
tags.forEach(tag => {
263-
if (t.includes(tag) !== true) {
264-
t.push(tag)
265-
}
266-
})
262+
if (tags && tags.length > 0) {
263+
tags.forEach(tag => {
264+
if (t.includes(tag) !== true) {
265+
t.push(tag)
266+
}
267+
})
268+
}
267269
})
268270
t.sort()
269271
this.categories = t

0 commit comments

Comments
 (0)