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:
Aleix Pol 2013-01-10 05:00:23 +01:00
parent de51d8e4d2
commit a7f4cf52be

View File

@ -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