Fix T74182: Crash saving images from non-image spaces

This commit is contained in:
Campbell Barton 2020-02-25 16:59:57 +11:00
parent 727d430811
commit 096936fe1d
Notes: blender-bot 2023-02-14 02:43:21 +01:00
Referenced by issue #74274, Blender 2.82a proposed revisions
Referenced by issue #74182, Blender crashes by saving a painted texture in properties/texture properties
1 changed files with 1 additions and 1 deletions

View File

@ -855,7 +855,7 @@ void uiTemplateImage(uiLayout *layout,
/* Disable editing if image was modified, to avoid losing changes. */
const bool is_dirty = BKE_image_is_dirty(ima);
if (is_dirty) {
if (is_dirty && CTX_wm_space_image(C)) {
uiLayout *row = uiLayoutRow(layout, true);
uiItemO(row, IFACE_("Save"), ICON_NONE, "image.save");
uiItemO(row, IFACE_("Discard"), ICON_NONE, "image.reload");