Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-08-28 23:30:29 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-08-29 01:16:07 +0400
commitd1c91016429e81aa96f4ff64da773deec8f060ee (patch)
tree49624e3d0dfd50e528c8336aa89e4ccf8d5e6ba6 /source/blender/editors/sculpt_paint/paint_image.c
parentb583894592e22468ef25cf2979577f6ce7fcf777 (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.c23
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);
+ }
}
}
}
- }
-
+ }
}
}
}