From 20bd521ab693af7549948af8f2268d56873a9b59 Mon Sep 17 00:00:00 2001 From: rahuljain-dev Date: Mon, 7 Oct 2024 11:32:48 +0530 Subject: [PATCH] ELEMENTS-1657: Fix nuxeo-selectivity error during _dataChanged function --- ui/widgets/nuxeo-selectivity.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/widgets/nuxeo-selectivity.js b/ui/widgets/nuxeo-selectivity.js index 02c10b81f..622113668 100644 --- a/ui/widgets/nuxeo-selectivity.js +++ b/ui/widgets/nuxeo-selectivity.js @@ -7358,10 +7358,12 @@ typedArrayTags[weakMapTag] = false; if (this._selectivity) { this._selectivity.setOptions({ items: this._wrap(this.data) }); const selectivityData = this._selectivity.getData(); - const wrapData = this._wrap(this.data); - const newData = wrapData.filter(obj => selectivityData.some(item => item.id === obj.id)); - if (newData.length !== 0 && JSON.stringify(newData) !== JSON.stringify(selectivityData)) { - this._selectivity.setData(newData); + if(selectivityData){ + const wrapData = this._wrap(this.data); + const newData = wrapData.filter(obj => selectivityData.some(item => item.id === obj.id)); + if (newData.length !== 0 && JSON.stringify(newData) !== JSON.stringify(selectivityData)) { + this._selectivity.setData(newData); + } } } }