From 5b3c15e3363aa7bea5d26c56191b7e8e74021868 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Nov 2017 16:05:28 +1100 Subject: Fix T53294: bpy.ops.image.open crash --- source/blender/editors/space_image/image_ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_image/image_ops.c') diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index f7df29ed2b6..24db8ba40fd 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1301,12 +1301,12 @@ static int image_open_exec(bContext *C, wmOperator *op) if (iod->iuser) { iuser = iod->iuser; } - else if (sa->spacetype == SPACE_IMAGE) { + else if (sa && sa->spacetype == SPACE_IMAGE) { SpaceImage *sima = sa->spacedata.first; ED_space_image_set(sima, scene, obedit, ima); iuser = &sima->iuser; } - else if (sa->spacetype == SPACE_VIEW3D) { + else if (sa && sa->spacetype == SPACE_VIEW3D) { View3D *v3d = sa->spacedata.first; for (BGpic *bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) { -- cgit v1.2.3