mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Fix crash when editing table after changing its schema
Fix a crash which happened when opening a table in the Edit Table dialog for modification and changing its schema and then (without reopening the dialog) change the schema again or doing some other modifications to the table. See issue #1131.
This commit is contained in:
@@ -749,8 +749,11 @@ void EditTableDialog::changeSchema(const QString& schema)
|
||||
// Update table if we're editing an existing table
|
||||
if(!m_bNewTable)
|
||||
{
|
||||
if(!pdb.renameColumn(curTable, m_table, QString(), sqlb::FieldPtr(), 0, schema))
|
||||
if(pdb.renameColumn(curTable, m_table, QString(), sqlb::FieldPtr(), 0, schema))
|
||||
{
|
||||
// Save the new schema name to use it from now on
|
||||
curTable.setSchema(schema);
|
||||
} else {
|
||||
QMessageBox::warning(this, QApplication::applicationName(), tr("Changing the table schema failed. Error message:\n%1").arg(pdb.lastError()));
|
||||
ui->comboSchema->setCurrentText(curTable.schema()); // Set it back to the original schema
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user