Browse Source

Replace crash in assimp with assertion

rdb 10 years ago
parent
commit
ad238ad995
1 changed files with 4 additions and 1 deletions
  1. 4 1
      pandatool/src/assimp/assimpLoader.cxx

+ 4 - 1
pandatool/src/assimp/assimpLoader.cxx

@@ -560,7 +560,10 @@ load_mesh(size_t index) {
   if (character) {
   if (character) {
     for (size_t i = 0; i < mesh.mNumBones; ++i) {
     for (size_t i = 0; i < mesh.mNumBones; ++i) {
       const aiBone &bone = *mesh.mBones[i];
       const aiBone &bone = *mesh.mBones[i];
-      CPT(JointVertexTransform) jvt = new JointVertexTransform(character->find_joint(bone.mName.C_Str()));
+      CharacterJoint *joint = character->find_joint(bone.mName.C_Str());
+      nassertd(joint != NULL) continue;
+
+      CPT(JointVertexTransform) jvt = new JointVertexTransform(joint);
 
 
       for (size_t j = 0; j < bone.mNumWeights; ++j) {
       for (size_t j = 0; j < bone.mNumWeights; ++j) {
           const aiVertexWeight &weight = bone.mWeights[j];
           const aiVertexWeight &weight = bone.mWeights[j];