From fbada715afcc61a245fbb56d01d294def19602d3 Mon Sep 17 00:00:00 2001 From: Boyuan Yang <073plan@gmail.com> Date: Thu, 22 Jul 2021 19:55:57 -0400 Subject: [PATCH] Fix nullptr reference when trayicon is disabled (#1742) --- src/core/controller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/controller.cpp b/src/core/controller.cpp index ffe0ad52..c20d73c6 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -196,7 +196,9 @@ void Controller::handleReplyCheckUpdates(QNetworkReply* reply) m_appLatestUrl = json["html_url"].toString(); QString newVersion = tr("New version %1 is available").arg(m_appLatestVersion); - m_appUpdates->setText(newVersion); + if (m_appUpdates != nullptr) { + m_appUpdates->setText(newVersion); + } if (m_showCheckAppUpdateStatus) { sendTrayNotification(newVersion, "Flameshot"); QDesktopServices::openUrl(QUrl(m_appLatestUrl));