Bug 799449 - Save As... sequence from SQL to XML format does not...

clear lock on the origin SQL book.

GncDbiSqlConnection::unlock_database function errored out if the last
dbi interaction resulted in an error, even if it was a harmless index
out of range. Ignore index out of range errors.
This commit is contained in:
John Ralls 2024-12-23 12:59:11 -08:00
parent bda17ff4d8
commit c549e203cb

View File

@ -173,7 +173,8 @@ GncDbiSqlConnection::unlock_database ()
{ {
if (m_conn == nullptr) return; if (m_conn == nullptr) return;
if (m_readonly) return; if (m_readonly) return;
g_return_if_fail (dbi_conn_error (m_conn, nullptr) == 0); auto dbi_error{dbi_conn_error (m_conn, nullptr)};
g_return_if_fail (dbi_error == DBI_ERROR_NONE || dbi_error == DBI_ERROR_BADIDX);
auto tables = m_provider->get_table_list (m_conn, lock_table); auto tables = m_provider->get_table_list (m_conn, lock_table);
if (tables.empty()) if (tables.empty())