Commit 94650fe5 authored by David Thompson's avatar David Thompson Committed by Kitware Robot

Merge topic 'fix-crashes'

6614df51 Fix segfaults at end of CMB tests.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !569
parents 2ceeea71 6614df51
......@@ -1301,7 +1301,7 @@ EntityRef EntityRef::embeddedIn() const
Model EntityRef::owningModel() const
{
ManagerPtr mgr = this->m_manager.lock();
return Model(mgr, mgr->modelOwningEntity(this->m_entity));
return mgr ? Model(mgr, mgr->modelOwningEntity(this->m_entity)) : Model();
}
/**\brief Return the SessionRef which owns this entity.
......@@ -1313,7 +1313,7 @@ Model EntityRef::owningModel() const
SessionRef EntityRef::owningSession() const
{
ManagerPtr mgr = this->m_manager.lock();
return SessionRef(mgr, mgr->sessionOwningEntity(this->m_entity));
return mgr ? SessionRef(mgr, mgr->sessionOwningEntity(this->m_entity)) : SessionRef();
}
/**\brief Return the Groups which contains this entity.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment