add null check

This commit is contained in:
Mads Rasmussen
2024-09-17 14:57:28 +02:00
parent fa28ed3d8e
commit 15ddacf0d4

View File

@@ -53,7 +53,9 @@ export class UmbTreePickerModalElement<TreeItemType extends UmbTreeItemModelBase
super.updated(_changedProperties);
if (_changedProperties.has('data')) {
this.#pickerContext.search.updateConfig({ ...this.data?.search });
if (this.data?.search) {
this.#pickerContext.search.updateConfig({ ...this.data?.search });
}
const multiple = this.data?.multiple ?? false;
this.#pickerContext.selection.setMultiple(multiple);