[phonemgr] Don't segfault when running the not yet installed gnome-phone-manager
- From: Daniele Forsi <dforsi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [phonemgr] Don't segfault when running the not yet installed gnome-phone-manager
- Date: Sat, 5 Feb 2011 10:52:04 +0000 (UTC)
commit d2e3cd9c421624d690f40a2417e56d8366313cdb
Author: Daniele Forsi <dforsi src gnome org>
Date: Fri Feb 4 12:03:25 2011 +0100
Don't segfault when running the not yet installed gnome-phone-manager
The user interface files are searched relative to the current directory
and when the filename is NULL both gtk_builder_add_objects_from_file()
and gtk_builder_add_from_file() return 0 without setting error so
dereferencing error->message causes a segmentation fault.
src/ui.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/ui.c b/src/ui.c
index e1ad433..9169849 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -77,6 +77,7 @@ GtkBuilder *get_ui (MyApp *app, char *widget)
GtkBuilder *ui;
fname = get_resource (app, "phonemgr.ui");
+ g_return_val_if_fail (fname, NULL);
ui = gtk_builder_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]