mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #154592: Add forgotten nullptr check
Pull Request: https://projects.blender.org/blender/blender/pulls/154609
This commit is contained in:
parent
60f6e0b917
commit
87cf0bcc26
1 changed files with 7 additions and 5 deletions
|
|
@ -1468,11 +1468,13 @@ static int /*eContextResult*/ node_context(const bContext *C,
|
|||
return CTX_RESULT_OK;
|
||||
}
|
||||
if (CTX_data_equals(member, "edit_image")) {
|
||||
if (bNode *node = bke::node_get_active(*snode->edittree)) {
|
||||
if (ELEM(node->type_legacy, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT)) {
|
||||
Image *image = id_cast<Image *>(node->id);
|
||||
CTX_data_id_pointer_set(result, &image->id);
|
||||
return CTX_RESULT_OK;
|
||||
if (snode->edittree != nullptr) {
|
||||
if (bNode *node = bke::node_get_active(*snode->edittree)) {
|
||||
if (ELEM(node->type_legacy, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT)) {
|
||||
Image *image = id_cast<Image *>(node->id);
|
||||
CTX_data_id_pointer_set(result, &image->id);
|
||||
return CTX_RESULT_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue