technology: Check if pending message is NULL before sending it back
authorSamuel Ortiz <sameo@linux.intel.com>
Thu, 1 Dec 2011 11:21:41 +0000 (12:21 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 1 Dec 2011 11:23:19 +0000 (12:23 +0100)
The message would be NULL when setting offline mode on and off.

Fixes BMC#24314

src/technology.c

index cfa7972..fb28ca5 100644 (file)
@@ -881,7 +881,8 @@ int __connman_technology_enable(enum connman_service_type type, DBusMessage *msg
 
 done:
        if (ret == 0) {
-               g_dbus_send_reply(connection, msg, DBUS_TYPE_INVALID);
+               if (msg != NULL)
+                       g_dbus_send_reply(connection, msg, DBUS_TYPE_INVALID);
                return ret;
        }
 
@@ -967,7 +968,8 @@ int __connman_technology_disable(enum connman_service_type type, DBusMessage *ms
 
 done:
        if (ret == 0) {
-               g_dbus_send_reply(connection, msg, DBUS_TYPE_INVALID);
+               if (msg != NULL)
+                       g_dbus_send_reply(connection, msg, DBUS_TYPE_INVALID);
                return ret;
        }