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:
authorCampbell Barton <campbell@blender.org>2022-07-22 05:25:10 +0300
committerCampbell Barton <campbell@blender.org>2022-07-22 05:25:10 +0300
commit72e249974aa7f6a3bd6d5c35c5d5e59cd1c3bded (patch)
treeff0ccb0584c6acb2f98277db5385f71766929ba4 /source/blender/editors/sculpt_paint
parentd3db38cfb1f223b81ab89c38bae0652a0d40c03e (diff)
Fix crash loading factory settings in image paint mode
Loading factory settings left the region NULL, causing the brushes poll function to crash.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.cc b/source/blender/editors/sculpt_paint/paint_image.cc
index 56cd4751881..6ed43fe6403 100644
--- a/source/blender/editors/sculpt_paint/paint_image.cc
+++ b/source/blender/editors/sculpt_paint/paint_image.cc
@@ -276,10 +276,11 @@ static bool image_paint_poll_ex(bContext *C, bool check_tool)
(ID_IS_LINKED(sima->image) || ID_IS_OVERRIDE_LIBRARY(sima->image))) {
return false;
}
- ARegion *region = CTX_wm_region(C);
-
- if ((sima->mode == SI_MODE_PAINT) && region->regiontype == RGN_TYPE_WINDOW) {
- return true;
+ if (sima->mode == SI_MODE_PAINT) {
+ const ARegion *region = CTX_wm_region(C);
+ if (region->regiontype == RGN_TYPE_WINDOW) {
+ return true;
+ }
}
}
}