summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qnetworkinterface_winrt.cpp
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@theqtcompany.com>2015-11-18 11:03:20 +0100
committerOliver Wolff <oliver.wolff@theqtcompany.com>2015-11-19 06:55:20 +0000
commitfecbe76d6e24c4025cf8efb012571d1535a938ff (patch)
treeed6f615875eff3157931ff7de939a7ea944db286 /src/network/kernel/qnetworkinterface_winrt.cpp
parent2ab6963e9597f42609632ff25a696b14a63d2fd8 (diff)
winrt: no assert when device is in airplane mode/has no internet connection
Task-number: QTBUG-49478 Change-Id: I1b95ca736d454f82f84374554e6cdec2555d29de Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Diffstat (limited to 'src/network/kernel/qnetworkinterface_winrt.cpp')
-rw-r--r--src/network/kernel/qnetworkinterface_winrt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/kernel/qnetworkinterface_winrt.cpp b/src/network/kernel/qnetworkinterface_winrt.cpp
index 6791caaf21..1945b2427f 100644
--- a/src/network/kernel/qnetworkinterface_winrt.cpp
+++ b/src/network/kernel/qnetworkinterface_winrt.cpp
@@ -76,6 +76,9 @@ static QNetworkInterfacePrivate *interfaceFromProfile(IConnectionProfile *profil
ComPtr<INetworkAdapter> adapter;
hr = profile->get_NetworkAdapter(&adapter);
+ // Indicates that no internet connection is available/the device is in airplane mode
+ if (hr == E_INVALIDARG)
+ return 0;
Q_ASSERT_SUCCEEDED(hr);
UINT32 type;
hr = adapter->get_IanaInterfaceType(&type);