From 24095724dc22bda13829b33b23b7555defbf871d Mon Sep 17 00:00:00 2001 From: Ting Chien Meng Date: Thu, 16 Jan 2025 21:28:30 +0800 Subject: [PATCH] check if remote url is defined first --- agent/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/src/index.ts b/agent/src/index.ts index 5e4c817efe..4cff10eff2 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -1101,9 +1101,10 @@ const checkPortAvailable = (port: number): Promise => { }); }; -const hasValidRemoteUrls = () => - process.env.REMOTE_CHARACTER_URLS != "" && - process.env.REMOTE_CHARACTER_URLS.startsWith("http") +const hasValidRemoteUrls = () => { + const remoteUrls = process.env.REMOTE_CHARACTER_URLS; + return remoteUrls && remoteUrls !== "" && remoteUrls.startsWith('http'); +}; const startAgents = async () => { const directClient = new DirectClient();