From 8a1ce9f23866008ff648123c8499e5c730d453e3 Mon Sep 17 00:00:00 2001 From: Bertrand Date: Wed, 24 Feb 2021 08:19:43 +0100 Subject: [PATCH] checking if JS script is loaded before compiling avoids crash --- scriptingwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scriptingwindow.cpp b/scriptingwindow.cpp index 101bf6b..fb27b73 100644 --- a/scriptingwindow.cpp +++ b/scriptingwindow.cpp @@ -345,8 +345,11 @@ void ScriptingWindow::revertScript() void ScriptingWindow::recompileScript() { - currentScript->scriptText = editor->toPlainText(); - currentScript->compileScript(); + if (currentScript) + { + currentScript->scriptText = editor->toPlainText(); + currentScript->compileScript(); + } } void ScriptingWindow::clickedLogClear()