mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 19:06:40 +00:00
Initialize and check pointer.
This commit is contained in:
parent
f1d05a93bf
commit
298db2ef76
1 changed files with 3 additions and 1 deletions
|
@ -150,7 +150,7 @@ void CSMWorld::CommandDispatcher::executeModify (QAbstractItemModel *sourceModel
|
|||
std::unique_ptr<CSMWorld::ModifyCommand> modifyData;
|
||||
std::unique_ptr<CSMWorld::UpdateCellCommand> modifyCell;
|
||||
|
||||
QAbstractItemModel *model;
|
||||
QAbstractItemModel *model(nullptr);
|
||||
QModelIndex index;
|
||||
|
||||
if (QAbstractProxyModel *proxy = dynamic_cast<QAbstractProxyModel *> (sourceModel))
|
||||
|
@ -160,6 +160,8 @@ void CSMWorld::CommandDispatcher::executeModify (QAbstractItemModel *sourceModel
|
|||
model = proxy->sourceModel();
|
||||
}
|
||||
|
||||
if (!model) return;
|
||||
|
||||
int columnId = model->data (index, ColumnBase::Role_ColumnId).toInt();
|
||||
|
||||
int stateColumn = dynamic_cast<CSMWorld::IdTable&>(*model).findColumnIndex(Columns::ColumnId_Modification);
|
||||
|
|
Loading…
Reference in a new issue