From 6ca6cfe91fed151ba60a18efb7f1788d537c0152 Mon Sep 17 00:00:00 2001 From: lucebac Date: Thu, 26 Sep 2024 15:21:48 +0200 Subject: [PATCH] do not set variable in condition Co-authored-by: David Walker --- src/ScriptEditor/ui/ScriptEditorRoot.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index 64a00b988..06dbf15cf 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -162,8 +162,11 @@ function Root(props: IProps): React.ReactElement { } function loadAllServerScripts(): void { - let server; - if (!currentScript || !(server = GetServer(currentScript.hostname))) { + if (!currentScript) { + return; + } + const server = GetServer(currentScript.hostname); + if (!server) { return; }