[Connection] ConnectionProfileManager.GetCurrentProfile() returns null if there is... 60/158460/1
authorchleun.moon <chleun.moon@samsung.com>
Wed, 1 Nov 2017 06:37:59 +0000 (15:37 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Wed, 1 Nov 2017 06:38:06 +0000 (15:38 +0900)
Change-Id: I419dac066d97c634d2184b677e9845f8266b794a
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs

index 2725077..56f6290 100755 (executable)
@@ -766,11 +766,19 @@ namespace Tizen.Network.Connection
             int ret = Interop.Connection.GetCurrentProfile(GetHandle(), out ProfileHandle);
             if ((ConnectionError)ret != ConnectionError.None)
             {
-                Log.Error(Globals.LogTag, "It failed to get current profile, " + (ConnectionError)ret);
-                ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
-                ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
-                ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
-                ConnectionErrorFactory.ThrowConnectionException(ret);
+                if ((ConnectionError)ret == ConnectionError.NoConnection)
+                {
+                    Log.Error(Globals.LogTag, "No connection " + (ConnectionError)ret);
+                    return null;
+                }
+                else
+                {
+                    Log.Error(Globals.LogTag, "It failed to get current profile, " + (ConnectionError)ret);
+                    ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet");
+                    ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)");
+                    ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released");
+                    ConnectionErrorFactory.ThrowConnectionException(ret);
+                }
             }
 
             ConnectionProfile Profile = new ConnectionProfile(ProfileHandle);