From 00d3a8198a77c5dcef3540d14e64e7dcc7e5013e Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 17 Feb 2024 01:41:23 +0100 Subject: [PATCH] Fix crash when network information backend is not available --- syncthingconnector/syncthingconnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncthingconnector/syncthingconnection.cpp b/syncthingconnector/syncthingconnection.cpp index c1ae149..f5144ae 100644 --- a/syncthingconnector/syncthingconnection.cpp +++ b/syncthingconnector/syncthingconnection.cpp @@ -282,7 +282,7 @@ void SyncthingConnection::handleMeteredConnection() { #ifdef SYNCTHINGCONNECTION_SUPPORT_METERED const auto *const networkInformation = QNetworkInformation::instance(); - if (!networkInformation->supports(QNetworkInformation::Feature::Metered)) { + if (!networkInformation || !networkInformation->supports(QNetworkInformation::Feature::Metered)) { return; } if (networkInformation->isMetered() && m_pausingOnMeteredConnection) {