File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212#include < qloggingcategory.h>
1313#include < qnamespace.h>
1414#include < qobject.h>
15+ #include < qpointer.h>
1516#include < qstring.h>
1617#include < qtmetamacros.h>
1718#include < qtypes.h>
@@ -438,7 +439,7 @@ void NMWirelessDevice::registerFrontendNetwork(NMWirelessNetwork* net) {
438439 [this , net](const QString& psk) {
439440 NMSettingsMap settings;
440441 settings[" 802-11-wireless-security" ][" psk" ] = psk;
441- if (auto * ref = net->referenceSettings ()) {
442+ if (const QPointer<NMSettings> ref = net->referenceSettings ()) {
442443 auto * call = ref->updateSettings (settings);
443444 QObject::connect (
444445 call,
@@ -451,10 +452,15 @@ void NMWirelessDevice::registerFrontendNetwork(NMWirelessNetwork* net) {
451452 qCInfo (logNetworkManager)
452453 << " Failed to write PSK for" << this ->path () + " :" << reply.error ().message ();
453454 } else {
454- emit this ->activateConnection (
455- QDBusObjectPath (ref->path ()),
456- QDBusObjectPath (this ->path ())
457- );
455+ if (!ref) {
456+ qCInfo (logNetworkManager) << " Failed to connectWithPsk to"
457+ << this ->path () + " : The settings disappeared." ;
458+ } else {
459+ emit this ->activateConnection (
460+ QDBusObjectPath (ref->path ()),
461+ QDBusObjectPath (this ->path ())
462+ );
463+ }
458464 }
459465 delete call;
460466 }
You can’t perform that action at this time.
0 commit comments