Skip to content

Commit 0f71231

Browse files
fix(VTreeView): null check when building tree from children (#13913)
* This fixes children is undefined/null when doing "children.map" when given an undefined/null children value * Changed the invalid check * Changed back to a null coalesce operator * Update packages/vuetify/src/components/VTreeview/VTreeview.ts Co-authored-by: Jacek Karczmarczyk <[email protected]>
1 parent 248add9 commit 0f71231

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vuetify/src/components/VTreeview/VTreeview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export default mixins(
201201
for (let i = 0; i < items.length; i++) {
202202
const item = items[i]
203203
const key = getObjectValueByPath(item, this.itemKey)
204-
const children = getObjectValueByPath(item, this.itemChildren, [])
204+
const children = getObjectValueByPath(item, this.itemChildren) ?? []
205205
const oldNode = this.nodes.hasOwnProperty(key) ? this.nodes[key] : {
206206
isSelected: false, isIndeterminate: false, isActive: false, isOpen: false, vnode: null,
207207
} as NodeState

0 commit comments

Comments
 (0)