diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-02-02 23:34:23 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-02-02 23:35:45 +0400 |
commit | 482823a1abc4e1fae7d010940b6b4bc867205f0d (patch) | |
tree | 6b6658619e2ff937f85babeb3658a9d073215c39 /source | |
parent | c0e6a0d318fd34bb4af2f5506d368389c40de65a (diff) |
Fix T38435: Crash when pressing MMB in walk mode
Snap code may be called with a NULL region, add check about this and assume ray_start is OK in this case!
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 9f48dc8995c..4499a9a03d2 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1542,8 +1542,9 @@ static bool snapDerivedMesh(short snap_mode, ARegion *ar, Object *ob, DerivedMes /* Only use closer ray_start in case of ortho view! In perspective one, ray_start may already * been *inside* boundbox, leading to snap failures (see T38409). + * Note also ar might be null (see T38435), in this case we assume ray_start is ok! */ - if (!((RegionView3D *)ar->regiondata)->is_persp) { + if (ar && !((RegionView3D *)ar->regiondata)->is_persp) { float ray_org_local[3]; copy_v3_v3(ray_org_local, ray_origin); |