[gnome-power-manager] Never return NULL from gpm_devicekit_get_object_icon()



commit 651cd63cfd5e1d47bd9c625a904d57e744284292
Author: Richard Hughes <richard hughsie com>
Date:   Mon Jun 15 10:20:12 2009 +0100

    Never return NULL from gpm_devicekit_get_object_icon()

 src/gpm-devicekit.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gpm-devicekit.c b/src/gpm-devicekit.c
index 89a0c69..9e36f9b 100644
--- a/src/gpm-devicekit.c
+++ b/src/gpm-devicekit.c
@@ -155,6 +155,13 @@ gpm_devicekit_get_object_icon (DkpDevice *device)
 			filename = g_strdup_printf ("gpm-%s-%s", prefix, index_str);
 		}
 	}
+
+	/* nothing matched */
+	if (filename == NULL) {
+		egg_warning ("nothing matched, falling back to default icon");
+		filename = g_strdup ("dialog-warning");
+	}
+
 	egg_debug ("got filename: %s", filename);
 	return filename;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]