From 35bce4fcab5b8464d4a47ee564dd5b03c058be6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Sj=C3=B6holm?= Date: Mon, 25 Aug 2014 23:40:07 +0300 Subject: [PATCH] [connectionagent] do not crash if tethering interface disappears --- connd/qconnectionagent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connd/qconnectionagent.cpp b/connd/qconnectionagent.cpp index 7826f24..9155e2c 100644 --- a/connd/qconnectionagent.cpp +++ b/connd/qconnectionagent.cpp @@ -155,6 +155,7 @@ void QConnectionAgent::onErrorReported(const QString &servicePath, const QString if (error == "connect-failed" && servicePath.contains("cellular") && netman->offlineMode()) return; + if (!tetheringWifiTech) return; // Suppress errors when switching to tethering mode if ((delayedTethering || tetheringWifiTech->tethering()) && servicePath.contains(QStringLiteral("wifi"))) return; @@ -825,6 +826,8 @@ void QConnectionAgent::startTethering(const QString &type) confFile.setValue("tetheringType",type); delayedTethering = true; + tetheringWifiTech = tetherTech; + if (!techPowered) { tetherTech->setPowered(true); } else {