Fix T64804 crash editing image paint fallof in edit mode
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 21 May 2019 14:31:42 +0000 (16:31 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 21 May 2019 14:50:37 +0000 (16:50 +0200)
source/blender/blenkernel/intern/paint.c

index bd06e2f..5849d69 100644 (file)
@@ -102,8 +102,11 @@ void BKE_paint_invalidate_overlay_tex(Scene *scene, ViewLayer *view_layer, const
 void BKE_paint_invalidate_cursor_overlay(Scene *scene, ViewLayer *view_layer, CurveMapping *curve)
 {
   Paint *p = BKE_paint_get_active(scene, view_layer);
-  Brush *br = p->brush;
+  if (p == NULL) {
+    return;
+  }
 
+  Brush *br = p->brush;
   if (br && br->curve == curve) {
     overlay_flags |= PAINT_OVERLAY_INVALID_CURVE;
   }