From a48d7407986d04492107a2ef16d0ff6f0d012c45 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 29 Apr 2016 00:00:43 +1000 Subject: Fix T48300: 3D view tools outside the 3d view crash --- source/blender/editors/mesh/editmesh_inset.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/mesh/editmesh_inset.c') diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index 937547c99ef..097117cce6b 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -143,8 +143,10 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal) opdata->mesh_backup = EDBM_redo_state_store(em); opdata->draw_handle_pixel = ED_region_draw_cb_activate(ar->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL); G.moving = G_TRANSFORM_EDIT; - opdata->twtype = v3d->twtype; - v3d->twtype = 0; + if (v3d) { + opdata->twtype = v3d->twtype; + v3d->twtype = 0; + } } return true; @@ -162,7 +164,9 @@ static void edbm_inset_exit(bContext *C, wmOperator *op) ARegion *ar = CTX_wm_region(C); EDBM_redo_state_free(&opdata->mesh_backup, NULL, false); ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel); - v3d->twtype = opdata->twtype; + if (v3d) { + v3d->twtype = opdata->twtype; + } G.moving = 0; } -- cgit v1.2.3