diff options
author | Cosimo Cecchi <cosimoc@src.gnome.org> | 2007-10-24 07:33:16 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@src.gnome.org> | 2007-10-24 07:33:16 +0800 |
commit | 521e6d117b60cf5441041e75b4889da79ad390e0 (patch) | |
tree | 3daa49d4108de7029610c93f73d0a04bb6b3c119 | |
parent | b92a4fb914719d4b6bbee8eb45b7a7a0b584c911 (diff) | |
download | gsoc2013-epiphany-521e6d117b60cf5441041e75b4889da79ad390e0.tar gsoc2013-epiphany-521e6d117b60cf5441041e75b4889da79ad390e0.tar.gz gsoc2013-epiphany-521e6d117b60cf5441041e75b4889da79ad390e0.tar.bz2 gsoc2013-epiphany-521e6d117b60cf5441041e75b4889da79ad390e0.tar.lz gsoc2013-epiphany-521e6d117b60cf5441041e75b4889da79ad390e0.tar.xz gsoc2013-epiphany-521e6d117b60cf5441041e75b4889da79ad390e0.tar.zst gsoc2013-epiphany-521e6d117b60cf5441041e75b4889da79ad390e0.zip |
Adds a check for NULL pointer in ephy-session.c, fixing wrong behaviour when
restoring Epiphany in some cases.
Fix for bug #488718, patch by Leonardo Boshell.
svn path=/trunk/; revision=7553
-rw-r--r-- | src/ephy-session.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c index 2e0ab766b..727a4927f 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -1466,8 +1466,6 @@ ephy_session_load (EphySession *session, if (xmlStrEqual (child->name, (const xmlChar *) "window")) { xmlChar *tmp; - gboolean success; - int active_tab; window = ephy_window_new (); widget = GTK_WIDGET (window); @@ -1480,13 +1478,19 @@ ephy_session_load (EphySession *session, /* Set focus to something sane */ tmp = xmlGetProp (child, (xmlChar *) "active-tab"); - success = int_from_string ((char *) tmp, &active_tab); - xmlFree (tmp); - if (success) - { - GtkWidget *notebook; - notebook = ephy_window_get_notebook (window); - gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), active_tab); + if (tmp != NULL) + { + gboolean success; + int active_tab; + + success = int_from_string ((char *) tmp, &active_tab); + xmlFree (tmp); + if (success) + { + GtkWidget *notebook; + notebook = ephy_window_get_notebook (window); + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), active_tab); + } } gtk_widget_grab_focus (GTK_WIDGET (ephy_window_get_active_tab (window))); |