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:
authorBastien Montagne <b.mont29@gmail.com>2020-02-26 21:22:48 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-02-26 21:31:37 +0300
commit2d423479bdeabd2a6bc1bbb51c4304c6f10fcd21 (patch)
treef8bd3746e06c536ad6f2ccd09178ded1d862e13a
parent9085b7e847bb8904e17597d651f1a8f4c7e9ae43 (diff)
Fix T73371: Crash caused by wrong logic in NULL pointer check.
-rw-r--r--source/blender/editors/util/ed_util.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 43ccc1a8250..72376b977eb 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -238,15 +238,12 @@ bool ED_editors_flush_edits_for_object_ex(Main *bmain,
/* Don't allow flushing while in the middle of a stroke (frees data in use).
* Auto-save prevents this from happening but scripts
* may cause a flush on saving: T53986. */
- if ((ob->sculpt && ob->sculpt->cache) == 0) {
-
- {
- char *needs_flush_ptr = &ob->sculpt->needs_flush_to_id;
- if (check_needs_flush && (*needs_flush_ptr == 0)) {
- return false;
- }
- *needs_flush_ptr = 0;
+ if (!ELEM(NULL, ob->sculpt, ob->sculpt->cache)) {
+ char *needs_flush_ptr = &ob->sculpt->needs_flush_to_id;
+ if (check_needs_flush && (*needs_flush_ptr == 0)) {
+ return false;
}
+ *needs_flush_ptr = 0;
/* flush multires changes (for sculpt) */
multires_flush_sculpt_updates(ob);