Fix crash cancelling search, caused by D3207

This commit is contained in:
Campbell Barton 2018-05-08 10:45:50 +02:00
parent 66b1cd45fb
commit 77cc265f18
1 changed files with 2 additions and 2 deletions

View File

@ -8497,8 +8497,8 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
uiButtonActivateType post_type = data->posttype;
/* Reset the button value when empty text is typed. */
if ((data->str != NULL) && (data->str[0] == '\0') &&
ELEM(RNA_property_type(but->rnaprop), PROP_FLOAT, PROP_INT))
if ((data->cancel == false) && (data->str != NULL) && (data->str[0] == '\0') &&
(but->rnaprop && ELEM(RNA_property_type(but->rnaprop), PROP_FLOAT, PROP_INT)))
{
MEM_SAFE_FREE(data->str);
ui_button_value_default(but, &data->value);