Skip to content

Commit

Permalink
check that reachability exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Gela committed Jan 2, 2024
1 parent 89e959e commit b6e4245
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/networkwatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ void NetworkWatcher::notificationClicked(NotificationHandler::Message message) {
QNetworkInformation::Reachability NetworkWatcher::getReachability() {
if (m_simulatedDisconnection) {
return QNetworkInformation::Reachability::Disconnected;
} else {
} else if (QNetworkInformation::instance()) {
return QNetworkInformation::instance()->reachability();
}
return QNetworkInformation::Reachability::Unknown;
}

void NetworkWatcher::simulateDisconnection(bool simulatedDisconnection) {
Expand Down

0 comments on commit b6e4245

Please sign in to comment.