Browse Source

don't crash if assertion fails

David Rose 23 years ago
parent
commit
c3e20f1a70
1 changed files with 4 additions and 1 deletions
  1. 4 1
      panda/src/pgraph/nodePath.I

+ 4 - 1
panda/src/pgraph/nodePath.I

@@ -1045,7 +1045,10 @@ unstash() {
 INLINE bool NodePath::
 INLINE bool NodePath::
 stash() {
 stash() {
   nassertr(!is_singleton(), false);
   nassertr(!is_singleton(), false);
-  return get_parent().node()->stash_child(node());
+  PandaNode *parent_node = get_parent().node();
+  PandaNode *this_node = node();
+  nassertr(parent_node != (PandaNode *)NULL && this_node != (PandaNode *)NULL, false);
+  return parent_node->stash_child(this_node);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////