Close database only if it was opened

This commit is contained in:
Vladislav Tronko
2016-08-25 13:46:24 +03:00
parent 50a1231580
commit 281cf5cb73

View File

@@ -274,8 +274,9 @@ bool MainWindow::fileOpen(const QString& fileName, bool dontAddToRecentFiles)
if(QFile::exists(wFile) )
{
// Close the database. If the user didn't want to close it, though, stop here
if(!fileClose())
return false;
if (db.isOpen())
if(!fileClose())
return false;
// Try opening it as a project file first
if(loadProject(wFile))