From 9683718f98d2d3c575ba2740022b25346d03452a Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 17 Mar 2021 22:15:31 +0200 Subject: LabelWidget: Fixed crash when text is empty --- src/ui/labelwidget.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ui') 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) { } iBool checkIcon_LabelWidget(iLabelWidget *d) { + if (isEmpty_String(&d->label)) { + d->icon = 0; + return iFalse; + } iStringConstIterator iter; init_StringConstIterator(&iter, &d->label); const iChar icon = iter.value; -- cgit v1.2.3