[gnome-photos/gnome-3-12] main-toolbar: Guard against being in a transitional state



commit 400eb9cae1da13c1a907eb269aacf227dac33ad3
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 17 13:28:15 2014 +0100

    main-toolbar: Guard against being in a transitional state
    
    We going back from the preview, we first unset the active item in
    PhotosItemManager, and then change the window mode in
    PhotosModeController. If we ever reach this code in the middle of this
    transition, we should not crash.
    
    Fixes: https://bugzilla.gnome.org/726519

 src/photos-main-toolbar.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index 2f97217..fa6c1f4 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -132,7 +132,8 @@ photos_main_toolbar_set_toolbar_title (PhotosMainToolbar *self)
       GObject *item;
 
       item = photos_base_manager_get_active_object (priv->item_mngr);
-      primary = g_markup_printf_escaped ("%s", photos_base_item_get_name (PHOTOS_BASE_ITEM (item)));
+      if (item != NULL)
+        primary = g_markup_printf_escaped ("%s", photos_base_item_get_name (PHOTOS_BASE_ITEM (item)));
     }
 
   if (selection_mode)


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