From 0a36f44bc7e30ea8399abcecbf8bcc5d2eb8cc61 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Wed, 6 Jan 2016 14:57:20 +0000 Subject: [PATCH] trivial: Fix a debug statement when no devices are detected --- src/fu-main.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/fu-main.c b/src/fu-main.c index f1944b519..f3ce00a59 100644 --- a/src/fu-main.c +++ b/src/fu-main.c @@ -811,13 +811,17 @@ fu_main_store_delay_cb (gpointer user_data) guint i; FuMainPrivate *priv = (FuMainPrivate *) user_data; - g_debug ("devices now in store:"); apps = as_store_get_apps (priv->store); - for (i = 0; i < apps->len; i++) { - app = g_ptr_array_index (apps, i); - g_debug ("%i\t%s\t%s", i + 1, - as_app_get_id (app), - as_app_get_name (app, NULL)); + if (apps->len == 0) { + g_debug ("no devices in store"); + } else { + g_debug ("devices now in store:"); + for (i = 0; i < apps->len; i++) { + app = g_ptr_array_index (apps, i); + g_debug ("%i\t%s\t%s", i + 1, + as_app_get_id (app), + as_app_get_name (app, NULL)); + } } priv->store_changed_id = 0; return G_SOURCE_REMOVE;