summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <[email protected]>2018-05-06 19:57:51 +0200
committerAlbert Astals Cid <[email protected]>2018-05-06 19:58:07 +0200
commit37a924609d79e9fb87ef9ad4234ab335aa4db362 (patch)
tree8cecccf3540803b044c8fd1102e7a652dc0ff8ed
parentc3a9cb76190a9bd0e5f70be9ae6ac6157d8e5e70 (diff)
Check for device not being null
Summary: In almost all places we use NetworkManager::findNetworkInterface we later check for the device is not null, do the same here BUGS: 393707 Reviewers: #plasma, jgrulich Reviewed By: jgrulich Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D12716
-rw-r--r--libs/models/networkmodel.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/models/networkmodel.cpp b/libs/models/networkmodel.cpp
index 82c3af7..0ba0867 100644
--- a/libs/models/networkmodel.cpp
+++ b/libs/models/networkmodel.cpp
@@ -594,7 +594,9 @@ void NetworkModel::activeVpnConnectionStateChanged(NetworkManager::VpnConnection
void NetworkModel::availableConnectionAppeared(const QString& connection)
{
NetworkManager::Device::Ptr device = NetworkManager::findNetworkInterface(qobject_cast<NetworkManager::Device*>(sender())->uni());
- addAvailableConnection(connection, device);
+ if (device) {
+ addAvailableConnection(connection, device);
+ }
}
void NetworkModel::availableConnectionDisappeared(const QString& connection)