diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-12 13:52:57 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-12 13:52:57 +0200 |
commit | 8bd055049a7878f4509dff5bcd0e152890665976 (patch) | |
tree | 43ed29914b2c8961562514063b153c38cf486781 /src/ui/labelwidget.c | |
parent | c391ce4fccf6de52b884a438329d12e76bd1a160 (diff) |
Mobile: Crash when dismissing sidebar during Edit mode
Diffstat (limited to 'src/ui/labelwidget.c')
-rw-r--r-- | src/ui/labelwidget.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index 5ad43b0e..4ace6204 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c | |||
@@ -492,6 +492,7 @@ int font_LabelWidget(const iLabelWidget *d) { | |||
492 | } | 492 | } |
493 | 493 | ||
494 | void updateSize_LabelWidget(iLabelWidget *d) { | 494 | void updateSize_LabelWidget(iLabelWidget *d) { |
495 | if (!d) return; | ||
495 | iWidget *w = as_Widget(d); | 496 | iWidget *w = as_Widget(d); |
496 | const int64_t flags = flags_Widget(w); | 497 | const int64_t flags = flags_Widget(w); |
497 | const iInt2 size = defaultSize_LabelWidget(d); | 498 | const iInt2 size = defaultSize_LabelWidget(d); |
@@ -562,18 +563,22 @@ void setTextColor_LabelWidget(iLabelWidget *d, int color) { | |||
562 | } | 563 | } |
563 | 564 | ||
564 | void setText_LabelWidget(iLabelWidget *d, const iString *text) { | 565 | void setText_LabelWidget(iLabelWidget *d, const iString *text) { |
565 | updateText_LabelWidget(d, text); | 566 | if (d) { |
566 | updateSize_LabelWidget(d); | 567 | updateText_LabelWidget(d, text); |
567 | if (isWrapped_LabelWidget(d)) { | 568 | updateSize_LabelWidget(d); |
568 | sizeChanged_LabelWidget_(d); | 569 | if (isWrapped_LabelWidget(d)) { |
570 | sizeChanged_LabelWidget_(d); | ||
571 | } | ||
569 | } | 572 | } |
570 | } | 573 | } |
571 | 574 | ||
572 | void setTextCStr_LabelWidget(iLabelWidget *d, const char *text) { | 575 | void setTextCStr_LabelWidget(iLabelWidget *d, const char *text) { |
573 | updateTextCStr_LabelWidget(d, text); | 576 | if (d) { |
574 | updateSize_LabelWidget(d); | 577 | updateTextCStr_LabelWidget(d, text); |
575 | if (isWrapped_LabelWidget(d)) { | 578 | updateSize_LabelWidget(d); |
576 | sizeChanged_LabelWidget_(d); | 579 | if (isWrapped_LabelWidget(d)) { |
580 | sizeChanged_LabelWidget_(d); | ||
581 | } | ||
577 | } | 582 | } |
578 | } | 583 | } |
579 | 584 | ||