From ba4a7364f55a18f2bcff22a7165733b0a3535b0e Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 9 Jul 2024 13:45:56 -0600 Subject: [PATCH] Avoid JS error in dataview row destroy after row is removed TypeError: Cannot read properties of null (reading 'classList') --- api/js/etemplate/et2_dataview_view_aoi.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/js/etemplate/et2_dataview_view_aoi.ts b/api/js/etemplate/et2_dataview_view_aoi.ts index 24755c7e8e..d490140c8f 100644 --- a/api/js/etemplate/et2_dataview_view_aoi.ts +++ b/api/js/etemplate/et2_dataview_view_aoi.ts @@ -149,6 +149,12 @@ export function et2_dataview_rowAOI(_node) this.checkBox.checked = selected; } + // Node might not be set yet / anymore + if(!this.node || typeof this.node?.classList == "undefined") + { + return; + } + this.node.classList.toggle('focused', egwBitIsSet(_state, EGW_AO_STATE_FOCUSED)); this.node.classList.toggle('selected', selected); this.node.classList.toggle('drag--moving', egwBitIsSet(_state, EGW_AO_STATE_DRAGGING));