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:
authorgaiaclary <gaia.clary@machinimatrix.org>2014-02-23 18:32:49 +0400
committergaiaclary <gaia.clary@machinimatrix.org>2014-02-23 18:33:10 +0400
commitd92f6b9903c8b914523ef7b3aa228a11f34bd605 (patch)
tree540253dc1119c9f2e2f6b91d94a9684c48a23c06 /source/blender/collada/ControllerExporter.cpp
parentcb1b6b549e8cd8eb6cb40fa03818a913e1f45c00 (diff)
T38763 Fix: avoid NPE When no custom properties are defined
Diffstat (limited to 'source/blender/collada/ControllerExporter.cpp')
-rw-r--r--source/blender/collada/ControllerExporter.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp
index 6a17afca6bd..c5443828f60 100644
--- a/source/blender/collada/ControllerExporter.cpp
+++ b/source/blender/collada/ControllerExporter.cpp
@@ -469,26 +469,25 @@ std::string ControllerExporter::add_joints_source(Object *ob_arm, ListBase *defb
static float get_property(Bone *bone, const char *key, float def)
{
- float result;
- IDProperty *property = IDP_GetPropertyFromGroup(bone->prop, key);
- if (property) {
- switch(property->type) {
- case IDP_INT:
- result = (float)(IDP_Int(property));
- break;
- case IDP_FLOAT:
- result = (float)(IDP_Float(property));
- break;
- case IDP_DOUBLE:
- result = (float)(IDP_Double(property));
- break;
- default:
- result = def;
+ float result = def;
+ if (bone->prop) {
+ IDProperty *property = IDP_GetPropertyFromGroup(bone->prop, key);
+ if (property) {
+ switch(property->type) {
+ case IDP_INT:
+ result = (float)(IDP_Int(property));
+ break;
+ case IDP_FLOAT:
+ result = (float)(IDP_Float(property));
+ break;
+ case IDP_DOUBLE:
+ result = (float)(IDP_Double(property));
+ break;
+ default:
+ result = def;
+ }
}
}
- else {
- result = def;
- }
return result;
}