diff options
author | Eric Cosky <eric_cosky> | 2020-12-16 14:12:06 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-12-16 14:13:49 +0300 |
commit | 4f128269b2dcf453647e7293f68f35173d45486a (patch) | |
tree | 556cd593ca277fd02b74dca3869c32d3edeee30e /source/blender | |
parent | 3fc9fc1cb46a49bbfa2da4443fb4edefcdc3b89d (diff) |
Fix possible crash with custom (add-on defined) icons
This change is a simple null check on the ID provided to icon_set_image() which
appears to be a legitimate value for the ID when used by some addins
(discovered with PowerSave shortly after syncing to main).
Differential Revision: https://developer.blender.org/D9866
Reviewed by: Julian Eisel
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 08e9ea31b53..899f4a6ddb1 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1416,7 +1416,7 @@ static void icon_set_image(const bContext *C, const bool delay = prv_img->rect[size] != NULL; icon_create_rect(prv_img, size); - if (use_job && BKE_previewimg_id_supports_jobs(id)) { + if (use_job && (!id || BKE_previewimg_id_supports_jobs(id))) { /* Job (background) version */ ED_preview_icon_job( C, prv_img, id, prv_img->rect[size], prv_img->w[size], prv_img->h[size], delay); |