guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] cuirass: check for null on specification edition page.


From: Jaming
Subject: [PATCH] cuirass: check for null on specification edition page.
Date: Sun, 09 Jun 2024 16:00:24 +0000

>From a5a99b1a7f930614bd88cadfe7a3470805403d48 Mon Sep 17 00:00:00 2001
From: Justin Martin <jaming@protonmail.com>
Date: Sun, 9 Jun 2024 11:20:25 -0400
Subject: [PATCH] cuirass: check for null on specification edition page.

* src/static/js/cuirass.js: check '.remove-channel' for null.
---
 src/static/js/cuirass.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/static/js/cuirass.js b/src/static/js/cuirass.js
index 4054256..42f28f1 100644
--- a/src/static/js/cuirass.js
+++ b/src/static/js/cuirass.js
@@ -247,8 +247,10 @@ ready(() => {
     /* Specification edition page. */
     (function(){
         if (document.querySelector(".edit-channel") !== null) {
-            
document.querySelector('.remove-channel').addEventListener('click', (e) =>
-                e.target.parentNode.remove());
+            if (document.querySelector('.remove-channel') !== null) {
+                
document.querySelector('.remove-channel').addEventListener('click', (e) =>
+                    e.target.parentNode.remove());
+            }
             document.querySelector('.add-channel').addEventListener('click', 
(e) => {
                 var clone = document.querySelector('.channel').cloneNode(true);
                 clone.setAttribute('class', 'form-group row channel-new');
--
2.45.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]