fix: don't call sourceData with an invalid role
This is related to bug #46
This commit is contained in:
parent
6ff055d47d
commit
9c3e57c02e
|
@ -154,6 +154,10 @@ QPair<QVariant, QVariant> RoleSorter::sourceData(const QModelIndex &sourceLeft,
|
|||
{
|
||||
QPair<QVariant, QVariant> pair;
|
||||
int role = proxyModel.roleForName(m_roleName);
|
||||
|
||||
if (role == -1)
|
||||
return pair;
|
||||
|
||||
pair.first = proxyModel.sourceData(sourceLeft, role);
|
||||
pair.second = proxyModel.sourceData(sourceRight, role);
|
||||
return pair;
|
||||
|
|
Loading…
Reference in New Issue