From e765fce2b46c9c2155ebdc7ce7e906d9d7762563 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 18 Feb 2011 11:31:45 -0600 Subject: [PATCH] test: don't crash libnm-glib if there are no devices for an active connection --- libnm-glib/libnm-glib-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c index be573812ea..6284fecab1 100644 --- a/libnm-glib/libnm-glib-test.c +++ b/libnm-glib/libnm-glib-test.c @@ -320,7 +320,8 @@ test_get_active_connections (NMClient *client) g_print (" %s\n", nm_object_get_path (g_ptr_array_index (connections, i))); devices = nm_active_connection_get_devices (g_ptr_array_index (connections, i)); - g_ptr_array_foreach ((GPtrArray *) devices, show_active_connection_device, NULL); + if (devices) + g_ptr_array_foreach ((GPtrArray *) devices, show_active_connection_device, NULL); } }