diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-10-18 12:03:47 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-10-18 17:52:21 +0300 |
commit | 00710018790b9bbb18fe4fe588976b631c688a3b (patch) | |
tree | 64710de9c330300c0002d66ee3506a72f03c19c2 /source/blender/editors/space_info | |
parent | fb88ff8f0c72be410c12a2f3b0226949d5041448 (diff) |
Fix T92246: sculpt crash displaying statistics in certain situations
It seems possible to switch object selection (if `Lock Object Modes` is
turned off) and end up with an object that has a SculptSession but a
NULL PBVH.
(I was not able to repro from scratch, but file from the report was
clearly in that state).
This would crash in displaying scene statistics.
While there might be a deeper fix (making sure PBVH is available early
enough -- possibly using `BKE_sculpt_object_pbvh_ensure`,
`sculpt_update_object` or friends), there are also many checks in tools
for PBVH, so the situation seems to be somewhat vaild/expected also in
other places.
So to fix this, just check for a non-NULL PBVH, returning early
otherwise.
Note: this leaves us with displaying 0/0 Faces & Vertices in the borked
case until an operation takes place that updates the PBVH.
Maniphest Tasks: T92246
Differential Revision: https://developer.blender.org/D12904
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/info_stats.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index e749e1a7947..13d15bc50a6 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -372,7 +372,7 @@ static void stats_object_sculpt(const Object *ob, SceneStats *stats) SculptSession *ss = ob->sculpt; - if (!ss) { + if (ss == NULL || ss->pbvh == NULL) { return; } |