[gnome-packagekit] Fix a crash where the desktop file that was installed has no root directory. Fixes rh#581682



commit 30abb526c3e95649257a9977991ccdbf97eaa413
Author: Richard Hughes <richard hughsie com>
Date:   Wed Apr 14 10:57:44 2010 +0100

    Fix a crash where the desktop file that was installed has no root directory. Fixes rh#581682

 src/gpk-desktop.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gpk-desktop.c b/src/gpk-desktop.c
index 8623b7d..68783b0 100644
--- a/src/gpk-desktop.c
+++ b/src/gpk-desktop.c
@@ -90,6 +90,10 @@ gpk_desktop_get_menu_path_submenu (const gchar *filename, const gchar *menu_file
 		goto out;
 	}
 	directory = gmenu_tree_get_root_directory (tree);
+	if (directory == NULL) {
+		egg_warning ("no directory for %s", menu_file);
+		goto out;
+	}
 	text = gpk_desktop_directory_get_menu_path (directory, filename);
 	if (text == NULL) {
 		egg_debug ("no path for %s", filename);



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