[gnome-calendar] window: add safety check
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: add safety check
- Date: Wed, 10 Dec 2014 13:49:46 +0000 (UTC)
commit e2a2721e9e85d3ed6b26ac0e07569aebda69ba0d
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Tue Dec 9 15:37:02 2014 -0500
window: add safety check
src/gcal-window.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 2773355..4187933 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -405,14 +405,16 @@ update_view (GcalWindow *window)
priv = gcal_window_get_instance_private (window);
widget = priv->views[priv->active_view];
+ if (widget != NULL)
+ {
+ header = gcal_view_get_left_header (GCAL_VIEW (widget));
+ g_object_set (priv->nav_bar, "left-header", header, NULL);
+ g_free (header);
- header = gcal_view_get_left_header (GCAL_VIEW (widget));
- g_object_set (priv->nav_bar, "left-header", header, NULL);
- g_free (header);
-
- header = gcal_view_get_right_header (GCAL_VIEW (widget));
- g_object_set (priv->nav_bar, "right-header", header, NULL);
- g_free (header);
+ header = gcal_view_get_right_header (GCAL_VIEW (widget));
+ g_object_set (priv->nav_bar, "right-header", header, NULL);
+ g_free (header);
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]