From a1188fb90c3ae239134a558f73d37694dcb610f8 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 13 Sep 2022 13:59:29 -0600 Subject: [PATCH] Handle case where remoteAddress is not yet avail --- core/client.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/client.js b/core/client.js index 9ac57f36..f73aae97 100644 --- a/core/client.js +++ b/core/client.js @@ -598,6 +598,10 @@ Client.prototype.isLocal = function () { }; Client.prototype.friendlyRemoteAddress = function () { + if (!this.remoteAddress) { + return 'N/A'; + } + // convert any :ffff: IPv4's to 32bit version return this.remoteAddress.replace(/^::ffff:/, '').replace(/^::1$/, 'localhost'); };