Fix segmentation fault with service type lookup
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 29 Nov 2009 16:26:51 +0000 (17:26 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 29 Nov 2009 16:26:51 +0000 (17:26 +0100)
src/service.c

index 09b5b5f..a3a6cf3 100644 (file)
@@ -1406,6 +1406,9 @@ static void favorite_changed(struct connman_service *service)
  */
 enum connman_service_type connman_service_get_type(struct connman_service *service)
 {
+       if (service == NULL)
+               return CONNMAN_SERVICE_TYPE_UNKNOWN;
+
        return service->type;
 }