From 4d1a5686a7620b163639492e1b81101b677d2472 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 23 Oct 2023 08:49:34 +0400 Subject: [PATCH] Fix crash in non-clickable spoilers. --- ui/text/text.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/text/text.cpp b/ui/text/text.cpp index 3b162e8..25c983a 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -373,8 +373,10 @@ void String::ExtendedWrap::adjustFrom(const ExtendedWrap *other) { reinterpret_cast(otherText + raw(this) - raw(other))); }; if (data) { - if (data->spoiler) { - adjust(data->spoiler->link); + if (const auto spoiler = data->spoiler.get()) { + if (spoiler->link) { + adjust(spoiler->link); + } } for (auto "e : data->quotes) { if (quote.copy) {