From 1511bd8eb47fdbd37af065ee4d06d499fa8a68b6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 4 Jun 2012 07:44:57 +0000 Subject: Correction to recent changes in paint module -- missed NULL check for active object --- source/blender/blenkernel/intern/paint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/paint.c') diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 25553448306..f7e3e103e99 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -106,7 +106,7 @@ Paint *paint_get_active_from_context(const bContext *C) return &ts->imapaint.paint; } } - else { + else if (obact) { switch (obact->mode) { case OB_MODE_SCULPT: return &ts->sculpt->paint; @@ -122,7 +122,8 @@ Paint *paint_get_active_from_context(const bContext *C) else return &ts->imapaint.paint; } - + } + else { /* default to image paint */ return &ts->imapaint.paint; } -- cgit v1.2.3