From 69a2c43ad9e85777f80717681967feebf7aa0859 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Wed, 2 Oct 2019 02:41:53 +0300 Subject: [PATCH] Fixed restricted date checking --- Telegram/SourceFiles/data/data_peer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index d8b3bbfff..ff0efe9ba 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -754,7 +754,8 @@ std::optional RestrictionError( using Flag = ChatRestriction; if (const auto restricted = peer->amRestricted(restriction)) { const auto all = restricted.isWithEveryone(); - if (!all && const auto channel = peer->asChannel()) { + const auto channel = peer->asChannel(); + if (!all && channel) { auto restrictedUntil = channel->restrictedUntil(); if (restrictedUntil > 0) { auto restrictedUntilDateTime = base::unixtime::parse(channel->restrictedUntil());