diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index c72829863..c280e4347 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -242,6 +242,7 @@ void Application::newInstanceConnected() { } void Application::readClients() { + // This method can be called before Messenger is constructed. QString startUrl; QStringList toSend; for (LocalClients::iterator i = _localClients.begin(), e = _localClients.end(); i != e; ++i) { @@ -286,7 +287,9 @@ void Application::readClients() { if (!startUrl.isEmpty()) { cSetStartUrl(startUrl); } - Messenger::Instance().checkStartUrl(); + if (auto messenger = Messenger::InstancePointer()) { + messenger->checkStartUrl(); + } } void Application::removeClients() {