diff --git a/panda/src/pgraphnodes/selectiveChildNode.I b/panda/src/pgraphnodes/selectiveChildNode.I index 08f536085b..8e0202b9a7 100644 --- a/panda/src/pgraphnodes/selectiveChildNode.I +++ b/panda/src/pgraphnodes/selectiveChildNode.I @@ -46,5 +46,6 @@ SelectiveChildNode(const SelectiveChildNode ©) : //////////////////////////////////////////////////////////////////// INLINE void SelectiveChildNode:: select_child(int n) { + nassertv(n >= 0); _selected_child = n; } diff --git a/panda/src/pgraphnodes/switchNode.I b/panda/src/pgraphnodes/switchNode.I index 09f32b7498..0386a1e32e 100644 --- a/panda/src/pgraphnodes/switchNode.I +++ b/panda/src/pgraphnodes/switchNode.I @@ -54,6 +54,7 @@ SwitchNode(const string &name) : //////////////////////////////////////////////////////////////////// INLINE void SwitchNode:: set_visible_child(int index) { + nassertv(index >= 0); CDWriter cdata(_cycler); cdata->_visible_child = index; }