Commit 9807db5c authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Don't emit dataChanged for invalid indices

getQModelIndex can return an invalid index. If that happens, we emit
dataChanged for an invalid index, which is incorrect and may cause
errors in other models.

CCBUG: 431155
parent 119a6976
......@@ -215,7 +215,9 @@ void ProcessDataModel::setEnabledAttributes(const QStringList &enabledAttributes
connect(attribute, &KSysGuard::ProcessAttribute::dataChanged, this, [this, columnIndex](KSysGuard::Process *process) {
if (process->pid() != -1) {
const QModelIndex index = d->getQModelIndex(process, columnIndex);
emit dataChanged(index, index);
if (index.isValid()) {
emit dataChanged(index, index);
}
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment