Fix crash reading deg_point_cache_transform.blend test, saved with 2.8.
[blender.git] / source / blender / blenkernel / intern / linestyle.c
index 0465c5d54f7930aedc6b0af6dbdee322692e97cd..878f38256b4ccceef80d8500c9d16ea5ef9d0cf6 100644 (file)
@@ -216,6 +216,10 @@ void BKE_linestyle_make_local(struct Main *bmain, FreestyleLineStyle *linestyle,
 FreestyleLineStyle *BKE_linestyle_active_from_scene(Scene *scene)
 {
        SceneRenderLayer *actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
 FreestyleLineStyle *BKE_linestyle_active_from_scene(Scene *scene)
 {
        SceneRenderLayer *actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
+       if (!actsrl) {
+               return NULL;
+       }
+
        FreestyleConfig *config = &actsrl->freestyleConfig;
        FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
 
        FreestyleConfig *config = &actsrl->freestyleConfig;
        FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);