diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 134e06c7c..fb31dcafe 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -880,17 +880,19 @@ void MainWindow::NewProjectFile() QString(), filter); - if (!filepath.isEmpty()) { - EnableProjectActions(true); - QFileInfo inf(filepath); - const QString filename = inf.fileName(); - FormatAndSetTitle(tr("Project:") + QString(" ") + filename); + if (filepath.isEmpty()) + return; + + EnableProjectActions(true); + QFileInfo inf(filepath); + const QString filename = inf.fileName(); + FormatAndSetTitle(tr("Project:") + QString(" ") + filename); + + delete mProject; + mProject = new Project(filepath, this); + mProject->Create(); + mProject->Edit(); - delete mProject; - mProject = new Project(filepath, this); - mProject->Create(); - mProject->Edit(); - } AddProjectMRU(filepath); CheckProject(mProject); }