fix crash when attempting to close project that is never opened

This commit is contained in:
garakmon 2020-05-11 17:12:37 -04:00
parent a47ed7b402
commit fcb320bd79

View file

@ -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();