fix regression [#36878], missing NULL checks for linestyle.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 30 Sep 2013 08:43:22 +0000 (08:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 30 Sep 2013 08:43:22 +0000 (08:43 +0000)
source/blender/editors/space_outliner/outliner_tree.c

index b86fba1398aa568a5258f234663e5e4f4cfa6141..10890a305fbfed47219aeccdaadedd9e0fcab414 100644 (file)
@@ -384,17 +384,21 @@ static void outliner_add_line_styles(SpaceOops *soops, ListBase *lb, Scene *sce,
 
        for (srl = sce->r.layers.first; srl; srl = srl->next) {
                for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
-                       lineset->linestyle->id.flag |= LIB_DOIT;
+                       FreestyleLineStyle *linestyle = lineset->linestyle;
+                       if (linestyle) {
+                               linestyle->id.flag |= LIB_DOIT;
+                       }
                }
        }
        for (srl = sce->r.layers.first; srl; srl = srl->next) {
                for (lineset = srl->freestyleConfig.linesets.first; lineset; lineset = lineset->next) {
                        FreestyleLineStyle *linestyle = lineset->linestyle;
-
-                       if (!(linestyle->id.flag & LIB_DOIT))
-                               continue;
-                       linestyle->id.flag &= ~LIB_DOIT;
-                       outliner_add_element(soops, lb, linestyle, te, 0, 0);
+                       if (linestyle) {
+                               if (!(linestyle->id.flag & LIB_DOIT))
+                                       continue;
+                               linestyle->id.flag &= ~LIB_DOIT;
+                               outliner_add_element(soops, lb, linestyle, te, 0, 0);
+                       }
                }
        }
 }