From ee03d5c45df213c78ee0d7589f6beb9f530be835 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 3 Jun 2011 09:56:10 +0000 Subject: [PATCH] fix compile warning --- panda/src/pgraph/nodePath.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/panda/src/pgraph/nodePath.cxx b/panda/src/pgraph/nodePath.cxx index 46326ee697..7dc087cf6d 100644 --- a/panda/src/pgraph/nodePath.cxx +++ b/panda/src/pgraph/nodePath.cxx @@ -3921,13 +3921,16 @@ get_shader_input(InternalName *id) const { //////////////////////////////////////////////////////////////////// const int NodePath:: get_instance_count() const { - nassertr_always(!is_empty(), NULL); + nassertr_always(!is_empty(), 0); + const RenderAttrib *attrib = node()->get_attrib(ShaderAttrib::get_class_slot()); + if (attrib != (const RenderAttrib *)NULL) { const ShaderAttrib *sa = DCAST(ShaderAttrib, attrib); return sa->get_instance_count(); } + return 0; }