Skip to content

Commit a35f19a

Browse files
committed
Fix #94
1 parent 364eefa commit a35f19a

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/ui/MainWindow.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,11 +1274,14 @@ bool MainWindow::on_actionCloseProject_triggered()
12741274
if (auto editor = getEditorForTab(i))
12751275
{
12761276
const auto filePath = currProject->getRelativePathOf(QDir::fromNativeSeparators(QDir::cleanPath(editor->getFilePath())));
1277-
openedTabs.append(filePath);
1278-
if (editor == currentEditor)
1277+
if (!filePath.isEmpty())
12791278
{
1280-
settings->setValue(key + "/currentTab", filePath);
1281-
currentEditor->saveState(*settings, key);
1279+
openedTabs.append(filePath);
1280+
if (editor == currentEditor)
1281+
{
1282+
settings->setValue(key + "/currentTab", filePath);
1283+
currentEditor->saveState(*settings, key);
1284+
}
12821285
}
12831286
}
12841287
}

0 commit comments

Comments
 (0)