Skip to content

Commit

Permalink
fix: return "" if address is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
0xB10C committed Oct 30, 2024
1 parent ec996c4 commit a7fccf1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/websocket/www/js/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ function uint8ArrayToHexString(uint8Array) {
}

function removePortFromIPPort(str) {
if (!str) {
return ""
}
let port = str.split(":").slice(-1)[0];
return str.replace(":" + port, "");
}
Expand Down

0 comments on commit a7fccf1

Please sign in to comment.