From 55c89e1f2a90133cd5f47240b510c464df74ca5d Mon Sep 17 00:00:00 2001
From: Benoit Alessandroni <benoit@happy-dev.fr>
Date: Thu, 30 Apr 2020 16:54:34 +0200
Subject: [PATCH] Fixing the instance_only check

---
 src/scripts/coopstarter.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js
index d0e048ad..af78327f 100644
--- a/src/scripts/coopstarter.js
+++ b/src/scripts/coopstarter.js
@@ -494,14 +494,16 @@ function addProperFilterToSearchComponents(targetId) {
       let instance_only = baseElement.querySelectorAll(
         ".instance_database_only"
       )[0];
-      let checkbox_instance_only = instance_only.querySelector("input");
-      if (checkbox_instance_only) {
-        checkbox_instance_only.onclick = function() {
-          if (this.checked) {
-            //We have to retrieve all data-scr needed to make them pointed only on the instance.
-            //How to?
-          }
-        };
+      if (instance_only) {
+        let checkbox_instance_only = instance_only.querySelector("input");
+        if (checkbox_instance_only) {
+          checkbox_instance_only.onclick = function() {
+            if (this.checked) {
+              //We have to retrieve all data-scr needed to make them pointed only on the instance.
+              //How to?
+            }
+          };
+        }
       }
 
       //MORE CRITERIAS
-- 
GitLab