Commit: 4a0e8121a5cc2d5ad43c477647c11b7a71c5832e
Author: Hans Goudey
Date:   Sun Jul 28 13:33:40 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rB4a0e8121a5cc2d5ad43c477647c11b7a71c5832e

Fix crash when loading profile widget

===================================================================

M       source/blender/blenloader/intern/readfile.c
M       source/blender/editors/interface/interface_draw.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index f78116d3c5e..8b0391b73bf 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2714,6 +2714,7 @@ static void direct_link_profilewidget(FileData *fd, 
ProfileWidget *prwdgt)
 {
   prwdgt->path = newdataadr(fd, prwdgt->path);
   prwdgt->table = NULL;
+  prwdgt->samples = NULL;
 }
 
 /** \} */
diff --git a/source/blender/editors/interface/interface_draw.c 
b/source/blender/editors/interface/interface_draw.c
index 641b0c673d2..ccb321c2c09 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -2340,7 +2340,7 @@ void ui_draw_but_PROFILE(ARegion *ar, uiBut *but, const 
uiWidgetColors *wcol, co
   /* Draw the sampled points in addition to the control points if they have 
been created */
   pts = prwdgt->samples;
   tot_points = (uint)prwdgt->totsegments;
-  if (tot_points > 0) {
+  if (tot_points > 0 && pts) {
     GPU_point_size(max_ff(2.0f, min_ff(UI_DPI_FAC / but->block->aspect * 3.0f, 
3.0f)));
     immBegin(GPU_PRIM_POINTS, tot_points);
     for (i = 0; i < tot_points; i++) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to