diff options
author | Dalai Felinto <dalai@blender.org> | 2020-11-19 12:33:08 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-11-19 12:33:08 +0300 |
commit | 256e77c987d2d8a3c1fc672eb75b3efe32441789 (patch) | |
tree | bcb2911d6b12983755291ca18e0d6224b1257a50 /source/blender/editors/interface | |
parent | ad58999b0d46731d8587d4eaf35f37f484cfe023 (diff) |
Fix T82833: GreasePencil crash when changing to Vertex Color mode
This is actually a user interface issue, introduced on 0688309988e5.
but->tip is checked for NULL in other parts, and rightly so, since here
it crashes Blender.
On a side note I don't know how to reliably reproduce the original bug
whose fix introduced this issue. That got on the way of seeing whether
this is the correct fix, if it happens outside greasepencil operators.
Maybe it is an operator that is missing a tooltip? Impossible to tell
without more information from said commit. That said since this happened
during the end of bcon3 and we are not in bcon4 I'm going ahead with
this NULL check commit.
Patch reviewed by Philipp Oeser and Sergey Sharybin.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_query.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c index d0075ba8617..83e48fad157 100644 --- a/source/blender/editors/interface/interface_query.c +++ b/source/blender/editors/interface/interface_query.c @@ -463,6 +463,10 @@ size_t ui_but_drawstr_len_without_sep_char(const uiBut *but) size_t ui_but_tip_len_only_first_line(const uiBut *but) { + if (but->tip == NULL) { + return 0; + } + const char *str_sep = strchr(but->tip, '\n'); if (str_sep != NULL) { return (str_sep - but->tip); |