diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-08-28 23:30:29 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-08-29 01:16:07 +0400 |
commit | d1c91016429e81aa96f4ff64da773deec8f060ee (patch) | |
tree | 49624e3d0dfd50e528c8336aa89e4ccf8d5e6ba6 /source/blender/editors/sculpt_paint/paint_image.c | |
parent | b583894592e22468ef25cf2979577f6ce7fcf777 (diff) |
Fix some crash cases after last commit
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index f596f330534..f0176bcd04d 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -1391,20 +1391,21 @@ void paint_proj_mesh_data_ensure(bContext *C, Object *ob, wmOperator *op) if (!ma->texpaintslot) { proj_paint_add_slot(C, ma, NULL); - for (sc = bmain->screen.first; sc; sc = sc->id.next) { - ScrArea *sa; - for (sa = sc->areabase.first; sa; sa = sa->next) { - SpaceLink *sl; - for (sl = sa->spacedata.first; sl; sl = sl->next) { - if (sl->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *)sl; - - ED_space_image_set(sima, scene, scene->obedit, ma->texpaintslot[0].ima); + if (ma->texpaintslot) { + for (sc = bmain->screen.first; sc; sc = sc->id.next) { + ScrArea *sa; + for (sa = sc->areabase.first; sa; sa = sa->next) { + SpaceLink *sl; + for (sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_IMAGE) { + SpaceImage *sima = (SpaceImage *)sl; + + ED_space_image_set(sima, scene, scene->obedit, ma->texpaintslot[0].ima); + } } } } - } - + } } } } |