diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-17 22:15:31 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-17 22:15:31 +0200 |
commit | 9683718f98d2d3c575ba2740022b25346d03452a (patch) | |
tree | 4769d4282351574868391f778cdeb23a83e74d79 /src/ui | |
parent | 48635cddf3cd2ca1f3dc22546949cc62434df6d9 (diff) |
LabelWidget: Fixed crash when text is empty
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/labelwidget.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index 690ad1c3..ea70977c 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c | |||
@@ -432,6 +432,10 @@ void setIcon_LabelWidget(iLabelWidget *d, iChar icon) { | |||
432 | } | 432 | } |
433 | 433 | ||
434 | iBool checkIcon_LabelWidget(iLabelWidget *d) { | 434 | iBool checkIcon_LabelWidget(iLabelWidget *d) { |
435 | if (isEmpty_String(&d->label)) { | ||
436 | d->icon = 0; | ||
437 | return iFalse; | ||
438 | } | ||
435 | iStringConstIterator iter; | 439 | iStringConstIterator iter; |
436 | init_StringConstIterator(&iter, &d->label); | 440 | init_StringConstIterator(&iter, &d->label); |
437 | const iChar icon = iter.value; | 441 | const iChar icon = iter.value; |