summaryrefslogtreecommitdiffstats
path: root/ogcp/static/js
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-13 10:07:47 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-13 10:07:47 +0200
commit2b905ddcaf9ffcf66edb5a228f8626bc9ac7d78e (patch)
tree8c6ec536850c816eecabc1749e0dd5c3fb5fbe27 /ogcp/static/js
parent17f8b25fe52913a92c0a9cf26c1d8ec1dc3472b9 (diff)
js: prevent js exception in pages without pill control
Add check to test if a pill control has been found and don't try to add mac data to non existent client pill controls.
Diffstat (limited to 'ogcp/static/js')
-rw-r--r--ogcp/static/js/ogcp.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js
index 1b6d888..3342ed8 100644
--- a/ogcp/static/js/ogcp.js
+++ b/ogcp/static/js/ogcp.js
@@ -5,6 +5,11 @@ let updateTimeoutId = null;
async function show_client_mac(pill_id) {
const pill = $('#' +pill_id);
+
+ if (!pill.length) {
+ return
+ }
+
const ip = pill.html().split('<br>')[1]
if (!macs.get(ip)) {