diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-31 13:17:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-31 13:17:58 +0400 |
commit | e129211605a9c80dca2ed76fd31c0c5e660e36b3 (patch) | |
tree | ef2bbb2ad9abddc198ae8306378fece750662212 /source/blender/editors/interface/interface_ops.c | |
parent | adfc77c1dbf8c85b1e594c64ebf9d06fa48a5543 (diff) |
add NULL checks in eyedropper_color_sample_fl since BKE_area_find_region_type may not find a region.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index ec6e9bbbfb3..5910909142c 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -148,7 +148,7 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int if (BLI_rcti_isect_pt(&sa->totrct, mx, my)) { if (sa->spacetype == SPACE_IMAGE) { ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); - if (BLI_rcti_isect_pt(&ar->winrct, mx, my)) { + if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) { SpaceImage *sima = sa->spacedata.first; int mval[2] = {mx - ar->winrct.xmin, my - ar->winrct.ymin}; @@ -160,7 +160,7 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int } else if (sa->spacetype == SPACE_NODE) { ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); - if (BLI_rcti_isect_pt(&ar->winrct, mx, my)) { + if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) { SpaceNode *snode = sa->spacedata.first; int mval[2] = {mx - ar->winrct.xmin, my - ar->winrct.ymin}; @@ -172,7 +172,7 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int } else if (sa->spacetype == SPACE_CLIP) { ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); - if (BLI_rcti_isect_pt(&ar->winrct, mx, my)) { + if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) { SpaceClip *sc = sa->spacedata.first; int mval[2] = {mx - ar->winrct.xmin, my - ar->winrct.ymin}; |