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
diff options
context:
space:
mode:
authorRobert Guetzkow <rjg>2020-03-17 18:44:29 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-03-17 18:46:55 +0300
commitd374237d43728ddc8503629cf1018befba82b81b (patch)
tree0dc88abf9781c141469fea2ec2ea37bc09a55427 /source/blender/editors/sculpt_paint/sculpt.c
parent24e44143a192053f552e4c4b1655146be3aaed61 (diff)
Fix T74838: fix dereferencing of NULL in sculpt_no_multires_poll when no active object exists
Fix crash when the operator search is used while no active object exists. The cause of the issue is an attempt to dereference `ob` when it is `NULL`. Therefore this patch checks the return value of `SCULPT_mode_poll()` first, to ensure that `ob` isn't `NULL`. Reviewed By: pablodp606 Maniphest Tasks: T74838 Differential Revision: https://developer.blender.org/D7156
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 79c4becd405..14c11523455 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -8371,9 +8371,8 @@ static void SCULPT_OT_optimize(wmOperatorType *ot)
static bool sculpt_no_multires_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
- SculptSession *ss = ob->sculpt;
- if (ss && ss->pbvh && SCULPT_mode_poll(C)) {
- return BKE_pbvh_type(ss->pbvh) != PBVH_GRIDS;
+ if (SCULPT_mode_poll(C) && ob->sculpt && ob->sculpt->pbvh) {
+ return BKE_pbvh_type(ob->sculpt->pbvh) != PBVH_GRIDS;
}
return false;
}