1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-25 22:39:42 +00:00

Fix exception when deleting a record while dialogue subview for that record is open.

This commit is contained in:
cc9cii 2015-12-08 00:27:20 +11:00
parent 68e16b6cee
commit 306bfcbdf2

View file

@ -163,7 +163,11 @@ void CSMWorld::IdTable::cloneRecord(const std::string& origin,
///This method can return only indexes to the top level table cells ///This method can return only indexes to the top level table cells
QModelIndex CSMWorld::IdTable::getModelIndex (const std::string& id, int column) const QModelIndex CSMWorld::IdTable::getModelIndex (const std::string& id, int column) const
{ {
return index(mIdCollection->getIndex (id), column); int idx = mIdCollection->searchId (id);
if (idx != -1)
return index(mIdCollection->getIndex (id), column);
else
return QModelIndex();
} }
void CSMWorld::IdTable::setRecord (const std::string& id, void CSMWorld::IdTable::setRecord (const std::string& id,