From fb868a2d77da93862101a094eab7c5d1f9b59d47 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 27 Dec 2023 01:28:59 -0500 Subject: [PATCH] Stop reporting interruption errors --- src/scriptapi/scripting.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/scriptapi/scripting.cpp b/src/scriptapi/scripting.cpp index 5ff90d37a..46f69a874 100644 --- a/src/scriptapi/scripting.cpp +++ b/src/scriptapi/scripting.cpp @@ -109,7 +109,14 @@ void Scripting::populateGlobalObject(MainWindow *mainWindow) { } bool Scripting::tryErrorJS(QJSValue js) { - if (!js.isError()) return false; + if (!js.isError()) + return false; + + // The script engine is interrupted during project reopen, during which + // all script modules intentionally return as error objects. + // We don't need to report these "errors" to the user. + if (!instance || !instance->engine || !instance->engine->isInterrupted()) + return false; // Get properties of the error QFileInfo file(js.property("fileName").toString());