diff --git a/CHANGELOG.md b/CHANGELOG.md index febe1cac..d61cd0ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d ### Changed - The Palette Editor now remembers the Bit Depth setting. - The min/max levels on the Wild Pokémon tab will now adjust automatically if they invalidate each other. +- If the recent project directory doesn't exist Porymap will open an empty project instead of failing with a misleading error message. ### Fixed - Fix text boxes in the Palette Editor calculating color incorrectly. diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 707e647f..aa5c5296 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -484,12 +484,18 @@ bool MainWindow::openRecentProject() { return false; QString default_dir = porymapConfig.getRecentProject(); - if (!default_dir.isNull() && default_dir.length() > 0) { - logInfo(QString("Opening recent project: '%1'").arg(default_dir)); - return openProject(default_dir); + if (default_dir.isNull() || default_dir.length() <= 0) + return false; + + if (!QDir(default_dir).exists()) { + QString message = QString("Recent project directory '%1' doesn't exist.").arg(QDir::toNativeSeparators(default_dir)); + logWarn(message); + this->statusBar()->showMessage(message); + return false; } - return false; + logInfo(QString("Opening recent project: '%1'").arg(default_dir)); + return openProject(default_dir); } bool MainWindow::openProject(QString dir) {