Fix crash in pre-launch logging.

Fixes #6635.
This commit is contained in:
John Preston 2019-10-03 12:37:00 +03:00
parent 4e7946d03e
commit 3779ad46ca
3 changed files with 10 additions and 3 deletions

View File

@ -27,12 +27,16 @@ Integration &Integration::Instance() {
return *IntegrationInstance;
}
bool Integration::Exists() {
return (IntegrationInstance != nullptr);
}
void Integration::textActionsUpdated() {
}
void Integration::activationFromTopPanel() {
void Integration::activationFromTopPanel() {
}
std::shared_ptr<ClickHandler> Integration::createLinkHandler(
EntityType type,
const QString &text,

View File

@ -28,6 +28,7 @@ class Integration {
public:
static void Set(not_null<Integration*> instance);
static Integration &Instance();
static bool Exists();
virtual void postponeCall(FnMut<void()> &&callable) = 0;
virtual void registerLeaveSubscription(not_null<QWidget*> widget) = 0;

View File

@ -12,7 +12,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Ui {
void WriteLogEntry(const QString &message) {
Integration::Instance().writeLogEntry(message);
if (Integration::Exists()) {
Integration::Instance().writeLogEntry(message);
}
}
} // namespace Ui