diff --git a/panda/src/gui/guiButton.cxx b/panda/src/gui/guiButton.cxx index 92ae611a8b..d6dd47bf26 100644 --- a/panda/src/gui/guiButton.cxx +++ b/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 diff --git a/panda/src/sgmanip/nodePath.cxx b/panda/src/sgmanip/nodePath.cxx index c30f7de1fc..0f80d5dae8 100644 --- a/panda/src/sgmanip/nodePath.cxx +++ b/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();