Check for device not being null
ClosedPublic

Authored by aacid on May 6 2018, 10:21 AM.

Details

Summary

In almost all places we use NetworkManager::findNetworkInterface we
later check for the device is not null, do the same here

BUGS: 393707

Diff Detail

Repository
R116 Plasma Network Management Applet
Branch
Plasma/5.12
Lint
No Linters Available
Unit
No Unit Test Coverage
aacid created this revision.May 6 2018, 10:21 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 6 2018, 10:21 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
aacid requested review of this revision.May 6 2018, 10:21 AM
aacid added a comment.May 6 2018, 10:22 AM

The other option would be not using findNetworkInterface at all since we're already doing qobject_cast<NetworkManager::Device*>(sender()) we already have the device, we don't really need to do a round-trip, but wihtout knowing this code at all it seems like if NetworkManager::findNetworkInterface doesn't find the interface it's because it's being dropped (which makes sense with the bug being about "crash when discoonecting VPN") so it seems better to just ignore the connection at that point.

jgrulich accepted this revision.May 6 2018, 4:25 PM
This revision is now accepted and ready to land.May 6 2018, 4:25 PM
aacid closed this revision.May 6 2018, 5:58 PM