[shotwell] Do not block viewer if we could not open photo



commit 61f502c3975d67765f34f53bc3080754cb51a1d1
Author: Jens Georg <mail jensge org>
Date:   Mon May 9 22:50:41 2016 +0200

    Do not block viewer if we could not open photo
    
    If for some reason shotwell was started as a viewer and could not access the
    photo (seems to happen e.g. on DAV shares mounted through gvfs), do not block
    the close button because we mark the file as non-closable due to parameter
    checking fail:
    
    V 4243 2016-05-09 22:47:00 [CRT] direct_photo_page_check_ok_to_close_photo:
    assertion 'IS_PHOTO (photo)' failed
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740436

 src/direct/DirectPhotoPage.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala
index 4fb1c50..6225a65 100644
--- a/src/direct/DirectPhotoPage.vala
+++ b/src/direct/DirectPhotoPage.vala
@@ -406,7 +406,12 @@ public class DirectPhotoPage : EditingHostPage {
         base.update_actions(selected_count, count);
     }
     
-    private bool check_ok_to_close_photo(Photo photo) {
+    private bool check_ok_to_close_photo(Photo? photo) {
+        // Means we failed to load the photo for some reason. Do not block
+        // shutdown
+        if (photo == null)
+            return true;
+
         if (!photo.has_alterations())
             return true;
         


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