From 2b905ddcaf9ffcf66edb5a228f8626bc9ac7d78e Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 13 May 2024 10:07:47 +0200 Subject: 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. --- ogcp/static/js/ogcp.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ogcp/static') 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('
')[1] if (!macs.get(ip)) { -- cgit v1.2.3-18-g5258