Fix (unreported): Crash if a right click is performed on an image datablock (open btn f.e.).

Only access/insert the button_pointer if it's not null...
This commit is contained in:
Thomas Beck 2017-05-09 20:12:25 +02:00
parent 4d38932cb4
commit 894513c7fd
1 changed files with 2 additions and 1 deletions

View File

@ -7012,7 +7012,8 @@ static bool ui_but_menu(bContext *C, uiBut *but)
}
/* Set the operator pointer for python access */
uiLayoutSetContextPointer(layout,"button_operator", but->opptr);
if (but->opptr)
uiLayoutSetContextPointer(layout,"button_operator", but->opptr);
uiItemS(layout);
}