fix T44648: Collada finding bone chains during import crashes when no bones are there

This commit is contained in:
Gaia Clary 2015-05-10 11:04:09 +02:00
parent 1fb97ffeed
commit 0525db39d1
Notes: blender-bot 2023-02-14 11:08:33 +01:00
Referenced by issue #44648, Blender Shuts Down when importing a .dae (Collada) file
1 changed files with 5 additions and 3 deletions

View File

@ -588,9 +588,11 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
/* and step back to edit mode to fix the leaf nodes */
ED_armature_to_edit(armature);
connect_bone_chains(armature, (Bone *)armature->bonebase.first, UNLIMITED_CHAIN_MAX);
fix_leaf_bones(armature, (Bone *)armature->bonebase.first);
if (armature->bonebase.first) {
/* Do this only if Armature has bones */
connect_bone_chains(armature, (Bone *)armature->bonebase.first, UNLIMITED_CHAIN_MAX);
fix_leaf_bones(armature, (Bone *)armature->bonebase.first);
}
// exit armature edit mode
ED_armature_from_edit(armature);
ED_armature_edit_free(armature);