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; }