mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-24 22:48:23 -05:00
Fix crash when a format is applied and one or more columns are selected
The at() method raises exception when the key is not in the map, so for std::map we have to check beforehand and return an empty filter.
This commit is contained in:
@@ -629,7 +629,9 @@ void TableBrowser::modifyFormat(std::function<void(CondFormat&)> changeFunction)
|
||||
const std::unordered_set<size_t>& columns = ui->dataTable->selectedCols();
|
||||
if (columns.size() > 0) {
|
||||
for (size_t column : columns) {
|
||||
const QString& filter = m_settings[currentlyBrowsedTableName()].filterValues.at(column);
|
||||
QString filter;
|
||||
if (m_settings[currentlyBrowsedTableName()].filterValues.count(column) > 0)
|
||||
filter = m_settings[currentlyBrowsedTableName()].filterValues.at(column);
|
||||
modifySingleFormat(false, filter, currentIndex().sibling(currentIndex().row(), static_cast<int>(column)), changeFunction);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user