mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Fix crash when clicking Create Index in empty database
This fixes a crash that would happen if you click the Create Index button while having opened an empty database file, i.e. without any table to create an index on yet.
This commit is contained in:
@@ -68,6 +68,14 @@ void EditIndexDialog::tableChanged(const QString& new_table, bool initialLoad)
|
||||
index.clearColumns();
|
||||
}
|
||||
|
||||
// Stop here if table name is empty
|
||||
if(new_table.isEmpty())
|
||||
{
|
||||
// Call checkInput() before to make sure the OK button is disabled
|
||||
checkInput();
|
||||
return;
|
||||
}
|
||||
|
||||
// And fill the table again
|
||||
QStringList fields = pdb.getObjectByName(new_table).dynamicCast<sqlb::Table>()->fieldNames();
|
||||
ui->tableIndexColumns->setRowCount(fields.size());
|
||||
|
||||
Reference in New Issue
Block a user