[gnome-power-manager] Fix a bug where we try to match and refresh a virtual device, which means g-p-s crashes on next star



commit a4e920e6121f051420e5cb0c75a35528d072a4f3
Author: Richard Hughes <richard hughsie com>
Date:   Thu Oct 15 16:10:08 2009 +0100

    Fix a bug where we try to match and refresh a virtual device, which means g-p-s crashes on next start

 src/gpm-statistics.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index 1e83723..03777fe 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -1443,6 +1443,10 @@ gpm_stats_highlight_device (const gchar *object_path)
 	GtkTreePath *path;
 	GtkWidget *widget;
 
+	/* check valid */
+	if (!g_str_has_prefix (object_path, "/"))
+		return;
+
 	/* we have to reuse the treeview data as it may be sorted */
 	ret = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store_devices), &iter);
 	for (i=0; ret; i++) {



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