check return value from vconf
[platform/core/uifw/stt.git] / common / stt_network.c
index 8538e80..e8e6535 100644 (file)
@@ -33,7 +33,11 @@ bool stt_network_is_connected()
 {
        /* Check network */
        int network_status = 0;
-       vconf_get_int(VCONFKEY_NETWORK_STATUS, &network_status);
+       int ret = vconf_get_int(VCONFKEY_NETWORK_STATUS, &network_status);
+       if (0 != ret) {
+               SLOG(LOG_WARN, stt_tag(), "[Network] Fail to get network status, ret(%d)", ret);
+               return false;
+       }
 
        if (network_status == VCONFKEY_NETWORK_OFF) {
                SLOG(LOG_WARN, stt_tag(), "[Network] Current network connection is OFF.");
@@ -43,4 +47,4 @@ bool stt_network_is_connected()
        SLOG(LOG_DEBUG, stt_tag(), "[Network] Network status is %d", network_status);
 
        return true;
-}
\ No newline at end of file
+}