From 10c646a367b498e007b910e3eeae0fa9c738f046 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 16 Jan 2023 12:55:45 +0100 Subject: [PATCH] Make sure the sort and shadowRoot are there before using them, avoiding execution error, since getValue it could be called in earlier stage eg: a699117b1b17e3b2ab64acdd7535a333479dede6 --- api/js/etemplate/Et2Nextmatch/ColumnSelection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Nextmatch/ColumnSelection.ts b/api/js/etemplate/Et2Nextmatch/ColumnSelection.ts index daeb77d1ee..5c2f6fbc56 100644 --- a/api/js/etemplate/Et2Nextmatch/ColumnSelection.ts +++ b/api/js/etemplate/Et2Nextmatch/ColumnSelection.ts @@ -206,7 +206,7 @@ export class Et2ColumnSelection extends Et2InputWidget(LitElement) { let value = []; - this.sort.toArray().forEach((val) => + this.sort?.toArray().forEach((val) => { let column = this.__columns.find((col) => col.id == val); let menuItem = this.shadowRoot.querySelector("[value='" + val + "']"); @@ -227,7 +227,7 @@ export class Et2ColumnSelection extends Et2InputWidget(LitElement) }); // Add in letters - this.shadowRoot.querySelectorAll("[part='columns'] > :not(.column)").forEach((i : SlMenuItem) => + this.shadowRoot?.querySelectorAll("[part='columns'] > :not(.column)").forEach((i : SlMenuItem) => { if(i.checked) {