Don't try to connect when service list is empty
authorSamuel Ortiz <sameo@linux.intel.com>
Sat, 24 Jul 2010 09:49:26 +0000 (11:49 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 26 Jul 2010 10:22:01 +0000 (12:22 +0200)
src/service.c

index 038d1a0..8aa0634 100644 (file)
@@ -1574,6 +1574,8 @@ __connman_service_connect_type(enum connman_service_type type)
         * the first available one if we have no type.
         */
        iter = g_sequence_get_begin_iter(service_list);
+       if (g_sequence_iter_is_end(iter))
+               return NULL;
        service = g_sequence_get(iter);
 
        /*