Fixed missing parent = NULL, if parentField() is NULL

This commit is contained in:
Jacob Støren
2015-08-13 11:47:04 +02:00
parent 369797b3d8
commit 8ad3f9b8c3

View File

@@ -113,9 +113,16 @@ void PdmObjectHandle::firstAncestorOfType(T*& ancestor) const
// Get next level parent
PdmObjectHandle* nextParent = NULL;
PdmFieldHandle* nextParentField = parent->parentField();
if (nextParentField) parent = nextParentField->ownerObject();
if (nextParentField)
{
parent = nextParentField->ownerObject();
}
else
{
parent = NULL;
}
}
}