IfcRelConnectsStructuralActivity::setRelatingElement is broken

23/09/2013
void IfcRelConnectsStructuralActivity::setRelatingElement(const Step::RefPtr< IfcStructuralActivityAssignmentSelect > &value) {
    if (m_relatingElement->getIfcStructuralItem() != NULL) {
        IfcStructuralItem * object = m_relatingElement->getIfcStructuralItem();
        object->m_assignedStructuralActivity.insert(this);
    }
    m_relatingElement = value;
}

should be:

void IfcRelConnectsStructuralActivity::setRelatingElement(const Step::RefPtr< IfcStructuralActivityAssignmentSelect > &value) {

    m_relatingElement = value;
    if (m_relatingElement->getIfcStructuralItem() != NULL) {
        IfcStructuralItem * object = m_relatingElement->getIfcStructuralItem();
        object->m_assignedStructuralActivity.insert(this);
    }
}

m_relatingElement cannot be used before set to value (initially NULL), this is causing the program to crash. Note that this is probably true for similar classes as this library is a compiled EXPRESS schema.

Component

Code

Category

bug
The content of this field is kept private and will not be shown publicly.