From a770f28b69cad7b9ed893a74dfbb3e736b7de894 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Mon, 22 Jan 2024 10:03:58 +0100
Subject: [PATCH] fix: check parameter  #132

---
 CHANGELOG.md                              | 4 ++++
 playground/datatable/index.html           | 6 +++---
 source/components/datatable/datatable.mjs | 4 ----
 source/dom/util.mjs                       | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2b60d1908..0ad6597cd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,8 @@
 
+## 2024-01-22 
+
+- fix exception [#132](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/132)
+
 ## [3.55.0] - 2023-11-29
 
 ### Add Features
diff --git a/playground/datatable/index.html b/playground/datatable/index.html
index 6aaefbf65..fc75f4015 100644
--- a/playground/datatable/index.html
+++ b/playground/datatable/index.html
@@ -62,9 +62,9 @@
 
             <monster-collapse id="my-collapse" data-monster-role="filter-collapse">
                 <div class="flex">
-                    <monster-tabs style="width: 100%"  data-monster-option-classes-button="monster-theme-primary-2" id="filtertabs">
+                    
                         <div data-monster-button-label="Filter" data-monster-state="active" class="active">
-                        <monster-datatable-filter id="listfilter1" slot="filter" data-monster-option-storedconfig-selector="#filtertabs">
+                        <monster-datatable-filter id="listfilter1" slot="filter">
                             <label data-monster-label="OID1" id="oid1"
                                    data-monster-template="${value | call:range:oid}">
                                 RANGE OID
@@ -96,7 +96,7 @@
                         </monster-datatable-filter>
                         </div>
                         <div data-monster-button-label="SDAFASDFDS"></div>
-                    </monster-tabs>
+                   
 
                 </div>
             </monster-collapse>
diff --git a/source/components/datatable/datatable.mjs b/source/components/datatable/datatable.mjs
index 9c455f7d0..feb87ac49 100644
--- a/source/components/datatable/datatable.mjs
+++ b/source/components/datatable/datatable.mjs
@@ -289,10 +289,6 @@ class DataTable extends CustomElement {
                         }
 
                     }).then(() => {
-
-                        const headers = this.getOption("headers", undefined);
-                        console.log(headers);
-
                         try {
                             initGridAndStructs.call(this, config, headerOrderMap);
                         } catch (error) {
diff --git a/source/dom/util.mjs b/source/dom/util.mjs
index 4507aa834..ae56a15c5 100644
--- a/source/dom/util.mjs
+++ b/source/dom/util.mjs
@@ -220,7 +220,7 @@ function findElementWithIdUpwards(element, targetId) {
  * @since 3.55.0
  */
 function findElementWithSelectorUpwards(element, selector) {
-	if (!element) {
+	if (!element||!selector) {
 		return null;
 	}
 
-- 
GitLab