From 92fca34a1661752fb61f82980e0ede726fe3ba6a Mon Sep 17 00:00:00 2001 From: Pascal Martin Date: Mon, 17 Jan 2022 17:23:02 -0800 Subject: [PATCH] Fix the case when there is no "Portal" menu item --- public/events.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/events.js b/public/events.js index 66813d0..40baccd 100644 --- a/public/events.js +++ b/public/events.js @@ -26,12 +26,13 @@ function eventShow (response) { for (var i = 0; i < elements.length; i++) { elements[i].innerHTML = response.host; } - if (response.proxy) { - document.getElementById('portal').href = - 'http://'+response.proxy+'/index.html'; - } else { - document.getElementById('portal').href = - 'http://'+response.host+'/index.html'; + portalmenu = document.getElementById('portal'); + if (portalmenu) { + if (response.proxy) { + portalmenu.href = 'http://'+response.proxy+'/index.html'; + } else { + portalmenu.href = 'http://'+response.host+'/index.html'; + } } }