mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Made adding of objects more robust
p4#: 21009
This commit is contained in:
@@ -567,22 +567,26 @@ void RimUiTreeModelPdm::addObjects(const QModelIndex& itemIndex, caf::PdmObjectG
|
||||
else if (dynamic_cast<RimCaseCollection*>(currentItem->dataObject().p()))
|
||||
{
|
||||
caseCollection = dynamic_cast<RimCaseCollection*>(currentItem->dataObject().p());
|
||||
CVF_ASSERT(caseCollection);
|
||||
|
||||
gridCaseGroup = caseCollection->parentCaseGroup();
|
||||
}
|
||||
else if (dynamic_cast<RimReservoir*>(currentItem->dataObject().p()))
|
||||
{
|
||||
RimReservoir* rimReservoir = dynamic_cast<RimReservoir*>(currentItem->dataObject().p());
|
||||
CVF_ASSERT(rimReservoir);
|
||||
|
||||
caseCollection = rimReservoir->parentCaseCollection();
|
||||
gridCaseGroup = caseCollection->parentCaseGroup();
|
||||
if (caseCollection)
|
||||
{
|
||||
gridCaseGroup = caseCollection->parentCaseGroup();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CVF_ASSERT(caseCollection);
|
||||
CVF_ASSERT(gridCaseGroup);
|
||||
|
||||
if (gridCaseGroup)
|
||||
{
|
||||
std::vector<caf::PdmPointer<RimResultReservoir> > typedObjects;
|
||||
|
||||
Reference in New Issue
Block a user