From fcb320bd796106182a1181b6072191c9d7593a48 Mon Sep 17 00:00:00 2001 From: garakmon Date: Mon, 11 May 2020 17:12:37 -0400 Subject: [PATCH] fix crash when attempting to close project that is never opened --- src/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7299ee13..4efc3270 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -399,7 +399,9 @@ void MainWindow::on_action_Open_Project_triggered() } QString dir = getExistingDirectory(recent); if (!dir.isEmpty()) { - Scripting::cb_ProjectClosed(this->editor->project->root); + if (this->editor && this->editor->project) { + Scripting::cb_ProjectClosed(this->editor->project->root); + } porymapConfig.setRecentProject(dir); if (!openProject(dir)) { this->initWindow();