From 0c24b78573c8c253a5c741cdca61da7967b12d6f Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 15 May 2004 12:45:51 +0000 Subject: [PATCH] Fred: include more check against null pointers and a raise in log level for missing objects. --- simgear/scene/model/model.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/simgear/scene/model/model.cxx b/simgear/scene/model/model.cxx index a9363596..78446fa5 100644 --- a/simgear/scene/model/model.cxx +++ b/simgear/scene/model/model.cxx @@ -170,7 +170,7 @@ sgMakeAnimation( ssgBranch * model, if (name_nodes.size() > 0) { object = find_named_node(model, name_nodes[0]->getStringValue()); if (object == 0) { - SG_LOG(SG_INPUT, SG_WARN, "Object " << name_nodes[0]->getStringValue() + SG_LOG(SG_INPUT, SG_ALERT, "Object " << name_nodes[0]->getStringValue() << " not found"); delete animation; animation = 0; @@ -189,7 +189,7 @@ sgMakeAnimation( ssgBranch * model, const char * name = name_nodes[i]->getStringValue(); object = find_named_node(model, name); if (object == 0) { - SG_LOG(SG_INPUT, SG_WARN, "Object " << name << " not found"); + SG_LOG(SG_INPUT, SG_ALERT, "Object " << name << " not found"); delete animation; animation = 0; } else { @@ -199,10 +199,12 @@ sgMakeAnimation( ssgBranch * model, } } - animation->init(); - branch->setUserData(animation); - branch->setTravCallback(SSG_CALLBACK_PRETRAV, animation_callback); - branch->setTravCallback(SSG_CALLBACK_POSTTRAV, restore_callback); + if ( animation != 0 ) { + animation->init(); + branch->setUserData(animation); + branch->setTravCallback(SSG_CALLBACK_PRETRAV, animation_callback); + branch->setTravCallback(SSG_CALLBACK_POSTTRAV, restore_callback); + } } -- 2.39.5