From 9d8e78ca1ea3b59eef0ec9532779da006959c345 Mon Sep 17 00:00:00 2001 From: Yaya-Cout Date: Sun, 14 Dec 2025 12:20:49 +0100 Subject: [PATCH] [simulator/web] Avoid broadcasting storage if navigator isn't defined (on Node CI) --- python/port/port.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python/port/port.cpp b/python/port/port.cpp index 7e3ff5718..dc89cb163 100644 --- a/python/port/port.cpp +++ b/python/port/port.cpp @@ -66,11 +66,14 @@ void python_execution_end() { }, name, content, size); } + // window isn't defined on Node (CI) EM_ASM({ - window.postMessage({ - type: 'epsilon_micropython_executionEnvironment_runCode_finished', - value: Module.___temp_storage_dump, - }); + if (window) { + window.postMessage({ + type: 'epsilon_micropython_executionEnvironment_runCode_finished', + value: Module.___temp_storage_dump, + }); + } delete Module.___temp_storage_dump; });