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
This commit is contained in:
Harley Acheson
2024-04-26 19:57:48 +02:00
committed by Harley Acheson
parent 83ed92d533
commit aa65bdbebc

View File

@@ -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;