Fix crash when opening project file

When opening a project file the following exception is raised in
src/sqlitedb.h:208

terminate called after throwing an instance of 'std::out_of_range'
  what():  map::at

This is related to 64a596a887
This commit is contained in:
mgrojo
2019-05-12 00:15:35 +02:00
parent 6bbf401abd
commit 30d0b183a5

View File

@@ -3589,6 +3589,9 @@ void MainWindow::unlockViewEditing(bool unlock, QString pk)
{
sqlb::ObjectIdentifier currentTable = currentlyBrowsedTableName();
if(currentTable.isEmpty())
return;
// If this isn't a view just unlock editing and return
if(db.getObjectByName(currentTable) && db.getObjectByName(currentTable)->type() != sqlb::Object::View)
{