Don't crash if there's no model
Even if the case doesn't make much sense, nobody likes crashing stuff.
This commit is contained in:
parent
de51d8e4d2
commit
a7f4cf52be
@ -129,7 +129,7 @@ void ColumnProxyModel::setRootIndex(const QModelIndex& index)
|
||||
|
||||
QModelIndex ColumnProxyModel::indexFromModel(QAbstractItemModel* model, int row, int column, const QModelIndex& parent)
|
||||
{
|
||||
return model->index(row, column, parent);
|
||||
return model ? model->index(row, column, parent) : QModelIndex();
|
||||
}
|
||||
|
||||
QVariant ColumnProxyModel::data(const QModelIndex& index, int role) const
|
||||
|
Loading…
Reference in New Issue
Block a user