Bläddra i källkod

*** empty log message ***

David Rose 25 år sedan
förälder
incheckning
b52209aecf
2 ändrade filer med 8 tillägg och 0 borttagningar
  1. 7 0
      panda/src/gui/guiButton.cxx
  2. 1 0
      panda/src/sgmanip/nodePath.cxx

+ 7 - 0
panda/src/gui/guiButton.cxx

@@ -111,6 +111,13 @@ static void click_button_up(CPT_Event e) {
 }
 
 void GuiButton::switch_state(GuiButton::States nstate) {
+  if (_mgr == (GuiManager*)0L) {
+    gui_cat.warning()
+      << "Tried to switch state of unmanaged button\n";
+    _state = nstate;
+    return;
+  }
+
   test_ref_count_integrity();
   States ostate = _state;
   // cleanup old state

+ 1 - 0
panda/src/sgmanip/nodePath.cxx

@@ -2565,6 +2565,7 @@ r_get_net_transitions(const ArcComponent *comp,
 ////////////////////////////////////////////////////////////////////
 string NodePath::
 format_node_name(Node *node) const {
+  nassertr(node != (Node *)NULL, string());
   string name;
   if (node->is_of_type(NamedNode::get_class_type())) {
     name = DCAST(NamedNode, node)->get_name();