From 9569c43126cd07699a92ce6040c9f1bf52fe2d16 Mon Sep 17 00:00:00 2001
From: david <david>
Date: Wed, 19 Jun 2002 02:58:06 +0000
Subject: [PATCH] Avoid a segfault when a named object is not found for an
 animation.

Ensure that global animations are applied to the model.
---
 src/Model/model.cxx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/Model/model.cxx b/src/Model/model.cxx
index 430c48cc0..3f1078cff 100644
--- a/src/Model/model.cxx
+++ b/src/Model/model.cxx
@@ -229,6 +229,8 @@ FG3DModel::init (const string &path)
       animation_nodes[i]->getChildren("object-name");
     if (name_nodes.size() < 1) {
       Animation * animation = make_animation(0, animation_nodes[i]);
+      if (animation != 0)
+	_animations.push_back(animation);
     } else {
       for (unsigned int j = 0; j < name_nodes.size(); j++) {
         Animation * animation =
@@ -309,7 +311,8 @@ FG3DModel::make_animation (const char * object_name,
     object = _model;
   }
 
-  animation->init(object, node);
+  if (animation != 0)
+    animation->init(object, node);
   return animation;
 }