Skip to content

Commit

Permalink
fixed: don't crash on missing core, warn instead
Browse files Browse the repository at this point in the history
git-svn-id: https://opensg.vrsource.org/svn/trunk@2242 4683daeb-ad0f-0410-a623-93161e962ae5
  • Loading branch information
cneumann committed Dec 29, 2009
1 parent 453ff8b commit f9befdd
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Source/System/GraphOp/OSGSingleTypeGraphOp.inl
Expand Up @@ -78,8 +78,18 @@ SingleTypeGraphOp<Type>::~SingleTypeGraphOp(void)
template < class Type > inline
Action::ResultE SingleTypeGraphOp<Type>::traverseEnter(Node *node)
{
if(node->getCore()->getType().isDerivedFrom(Type::getClassType()))
NodeCore *core = node->getCore();

if(core != NULL && core->getType().isDerivedFrom(Type::getClassType()))
{
travNodeEnter(node);
}
else if(core == NULL)
{
SWARNING << "SingleTypeGraphOp<>::traverseEnter: Core is NULL."
<< std::endl;
}

return Action::Continue;
}

Expand All @@ -88,8 +98,18 @@ Action::ResultE SingleTypeGraphOp<Type>::traverseLeave(
Node *node,
Action::ResultE)
{
if(node->getCore()->getType().isDerivedFrom(Type::getClassType()))
NodeCore *core = node->getCore();

if(core != NULL && core->getType().isDerivedFrom(Type::getClassType()))
{
travNodeLeave(node);
}
else if(core == NULL)
{
SWARNING << "SingleTypeGraphOp<>::traverseLeave: Core is NULL."
<< std::endl;
}

return Action::Continue;
}

Expand Down

0 comments on commit f9befdd

Please sign in to comment.