From 9ee83caaa214ed17f038ff25a066bfcb9b7fa61e Mon Sep 17 00:00:00 2001 From: Jan-Peter Nilsson Date: Wed, 12 Jan 2011 00:20:18 +0100 Subject: [PATCH] Avoid crash when no bones are available --- components/nifogre/ogre_nif_loader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 4a1696631..df1898764 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -643,6 +643,11 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou for (std::vector::iterator it = boneList.begin(); it != boneList.end(); it++) { + if(mSkel.isNull()) + { + std::cout << "No skeleton for :" << shape->skin->bones[boneIndex].name.toString() << std::endl; + break; + } //get the bone from bones array of skindata bonePtr = mSkel->getBone(shape->skin->bones[boneIndex].name.toString());