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
path: root/source
diff options
context:
space:
mode:
authorDeep Majumder <dmcoder>2020-08-05 21:34:12 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-08-05 21:45:46 +0300
commitc323f3e90a4a0d15e7d9e844e0473ed62a25862f (patch)
tree5609fa3ad6ff9035f72756c56158c5d3b6afd120 /source
parentf3e724b93d5ab74056607a76888b030bdd379484 (diff)
Fix T77548: Crash when using Add Object Tool with Normal Orientation and zero objects in scene
The crash is caused by the fact that a NULL Object pointer is passed to calculate the transform orientation, which has been set to normal. A check has been include to detect the same. Differential Revision: https://developer.blender.org/D7951
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/transform/transform_orientations.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 493b52495db..e805743e6bb 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -467,14 +467,14 @@ short ED_transform_calc_orientation_from_type_ex(const bContext *C,
return V3D_ORIENT_GLOBAL;
}
case V3D_ORIENT_GIMBAL: {
- if (gimbal_axis(ob, r_mat)) {
+ if (ob && gimbal_axis(ob, r_mat)) {
return V3D_ORIENT_GIMBAL;
}
/* if not gimbal, fall through to normal */
ATTR_FALLTHROUGH;
}
case V3D_ORIENT_NORMAL: {
- if (obedit || ob->mode & OB_MODE_POSE) {
+ if (obedit || (ob && ob->mode & OB_MODE_POSE)) {
ED_getTransformOrientationMatrix(C, r_mat, pivot_point);
return V3D_ORIENT_NORMAL;
}