diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-03-02 04:53:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-03-02 04:53:55 +0300 |
commit | aefb68c84d574359a20f61868b84b320b4aa0496 (patch) | |
tree | 41fbe6ff3222162face50ab6454a525bbccc66a3 /source | |
parent | c32e8fb09f08a5f9f8c8a261d864d32906140e29 (diff) |
Fix assert in UI code
Dont attempt to clip empty string
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index f803622ed62..5898f3b7e6b 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -4087,7 +4087,9 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, const char *name, int ic const float minwidth = (float)(UI_DPI_ICON_SIZE); BLI_strncpy(drawstr, name, sizeof(drawstr)); - UI_text_clip_middle_ex(fstyle, drawstr, okwidth, minwidth, max_len, '\0'); + if (drawstr[0]) { + UI_text_clip_middle_ex(fstyle, drawstr, okwidth, minwidth, max_len, '\0'); + } glColor4ubv((unsigned char *)wt->wcol.text); UI_fontstyle_draw(fstyle, rect, drawstr); |