Issue #1484 & #1480: crash when closing a DB having scrolled a table

Following a series of signals after closing the DB the application reaches
SqliteTableModel::isEditable() which isn't prepared for closed databases.
Taking this into account fixes the crash.

This crash seems to have being introduced in 3da520cdd1
This commit is contained in:
mgrojo
2018-07-28 14:34:08 +02:00
parent 01bf059270
commit e1ef492d78
+1 -1
View File
@@ -913,7 +913,7 @@ void SqliteTableModel::setPseudoPk(const QString& pseudoPk)
bool SqliteTableModel::isEditable() const
{
return !m_sTable.isEmpty() && (m_db.getObjectByName(m_sTable)->type() == sqlb::Object::Types::Table || !m_pseudoPk.isEmpty());
return !m_sTable.isEmpty() && m_db.isOpen() && (m_db.getObjectByName(m_sTable)->type() == sqlb::Object::Types::Table || !m_pseudoPk.isEmpty());
}
void SqliteTableModel::triggerCacheLoad (int row) const