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



commit cbc36f697cf1ff7df911dc25183d58c98da7749d
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 c357aa7..3d67a8f 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]