From aa65bdbebca39b7e53f7e467b5ea313e0c33ede5 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 26 Apr 2024 19:57:48 +0200 Subject: [PATCH] Fix #121108: Improved Poll Function for IMAGE_OT_clipboard_paste Ensure that the current area is an Image Editor before allowing clipboard paste, since that will fail. Pull Request: https://projects.blender.org/blender/blender/pulls/121142 --- source/blender/editors/space_image/image_ops.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/editors/space_image/image_ops.cc b/source/blender/editors/space_image/image_ops.cc index 7e13392986a..293764bb38e 100644 --- a/source/blender/editors/space_image/image_ops.cc +++ b/source/blender/editors/space_image/image_ops.cc @@ -3009,6 +3009,12 @@ static int image_clipboard_paste_exec(bContext *C, wmOperator *op) static bool image_clipboard_paste_poll(bContext *C) { + SpaceImage *sima = CTX_wm_space_image(C); + if (!sima) { + CTX_wm_operator_poll_msg_set(C, "Image Editor not found"); + return false; + } + if (!WM_clipboard_image_available()) { CTX_wm_operator_poll_msg_set(C, "No compatible images are on the clipboard"); return false;