Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2012-06-14 18:47:41 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2012-06-14 18:47:41 +0400
commit43864f9103d726fa3c425afb87d38433a2c01ba6 (patch)
tree7eb429e0d02ed858bf6719d8e69df46515b2a4bc /source/blender/collada
parent931aeeb1f22d06e47357866139ff9c578b64bf7b (diff)
fix a nullpointer exception when data missing in dae file
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/ArmatureImporter.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index c58b6f3101d..115f129cb88 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -654,11 +654,17 @@ void ArmatureImporter::make_armatures(bContext *C)
create_armature_bones(skin);
// link armature with a mesh object
- Object *ob = mesh_importer->get_object_by_geom_uid(*get_geometry_uid(skin.get_controller_uid()));
- if (ob)
- skin.link_armature(C, ob, joint_by_uid, this);
+ const COLLADAFW::UniqueId &uid = skin.get_controller_uid();
+ const COLLADAFW::UniqueId *guid = get_geometry_uid(uid);
+ if (guid != NULL) {
+ Object *ob = mesh_importer->get_object_by_geom_uid(*guid);
+ if (ob)
+ skin.link_armature(C, ob, joint_by_uid, this);
+ else
+ fprintf(stderr, "Cannot find object to link armature with.\n");
+ }
else
- fprintf(stderr, "Cannot find object to link armature with.\n");
+ fprintf(stderr, "Cannot find geometry to link armature with.\n");
// set armature parent if any
Object *par = skin.get_parent();