Correction to recent changes in paint module -- missed NULL check for active object

This commit is contained in:
Sergey Sharybin
2012-06-04 07:44:57 +00:00
parent eb81192069
commit 1511bd8eb4

View File

@@ -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;
}