} else { // Update top groups (other except parts
QModelIndex aIndex = myModel->findParent(aObject);
int aStart = myModel->rowCount(aIndex) - 1;
+ if (aStart < 0) aStart = 0;
aIndex = createIndex(aIndex.row(), aIndex.column(), (void*)getModelIndex(aIndex));
insertRow(aStart, aIndex);
}
if (theObject == aRootDoc->object(ModelAPI_Feature::group(), aId))
break;
}
- Q_ASSERT(aId < aNb);
- return index(aId + historyOffset(), 0, QModelIndex());
+ if (aId < aNb)
+ return index(aId + historyOffset(), 0, QModelIndex());
} else {
QModelIndex aIndex = myModel->objectIndex(theObject);
return aIndex.isValid()?