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
path: root/source
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-03-12 12:33:32 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-03-21 14:46:26 +0300
commit5dd747a54cfb8f0f822b02c8b932083f016b11c8 (patch)
treeb2870368a4afde85fc56253f3f951991d4a1b2c7 /source
parent2b8d778a68b53d63d8c897d5150951ecaecc6dc8 (diff)
Fix T96352: Gpencil crash using Normalize Thickness with Curves
The stroke curve data could be NULL.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index afb786da8c6..2ac7ec4f25c 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -5445,9 +5445,10 @@ static int gpencil_stroke_normalize_exec(bContext *C, wmOperator *op)
if (ED_gpencil_stroke_can_use(C, gps) == false) {
continue;
}
-
- bool selected = (is_curve_edit) ? gps->editcurve->flag |= GP_CURVE_SELECT :
- (gps->flag & GP_STROKE_SELECT);
+ bool is_curve_ready = (gps->editcurve != NULL);
+ bool selected = (is_curve_edit && is_curve_ready) ?
+ gps->editcurve->flag |= GP_CURVE_SELECT :
+ (gps->flag & GP_STROKE_SELECT);
if (!selected) {
continue;
}
@@ -5460,7 +5461,7 @@ static int gpencil_stroke_normalize_exec(bContext *C, wmOperator *op)
}
/* Loop all Polyline points. */
- if (!is_curve_edit) {
+ if (!is_curve_edit || !is_curve_ready) {
for (int i = 0; i < gps->totpoints; i++) {
bGPDspoint *pt = &gps->points[i];
if (mode == GP_NORMALIZE_THICKNESS) {