From a7fccf1a53a7de06f9267bc7f28016025971006c Mon Sep 17 00:00:00 2001 From: 0xb10c Date: Tue, 15 Oct 2024 15:22:46 +0200 Subject: [PATCH] fix: return "" if address is undefined --- tools/websocket/www/js/lib.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/websocket/www/js/lib.js b/tools/websocket/www/js/lib.js index a8a0627..28cb6e4 100644 --- a/tools/websocket/www/js/lib.js +++ b/tools/websocket/www/js/lib.js @@ -5,6 +5,9 @@ function uint8ArrayToHexString(uint8Array) { } function removePortFromIPPort(str) { + if (!str) { + return "" + } let port = str.split(":").slice(-1)[0]; return str.replace(":" + port, ""); }