From 30d0b183a56e55296e19a4347548cf5907cc24e8 Mon Sep 17 00:00:00 2001 From: mgrojo Date: Sun, 12 May 2019 00:15:35 +0200 Subject: [PATCH] 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 64a596a88786fab53d19bf00b6c3a5eb0e86a9d0 --- src/MainWindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e7dec25f..98d4af07 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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) {