[shotwell] Prevent crash when removing the event's last photo



commit d076d4c54fbc0c24a14b9f70757afa0e69712eb4
Author: Jens Georg <mail jensge org>
Date:   Sat Jan 13 23:05:18 2018 +0100

    Prevent crash when removing the event's last photo
    
    Issue is that this would destroy the event and destroy the media page,
    afterwards trying to update the undo list on the now destroyed view
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786531

 src/MediaPage.vala |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/MediaPage.vala b/src/MediaPage.vala
index 0b8c3ac..fb95b21 100644
--- a/src/MediaPage.vala
+++ b/src/MediaPage.vala
@@ -775,14 +775,15 @@ public abstract class MediaPage : CheckerboardPage {
             restore_point = get_view().get_next(cursor) as CheckerboardItem;
         }
 
+        if ((restore_point != null) && (get_view().contains(restore_point))) {
+            set_cursor(restore_point);
+        }
+
         if (get_view().get_selected_count() > 0) {
             get_command_manager().execute(new TrashUntrashPhotosCommand(
                 (Gee.Collection<MediaSource>) get_view().get_selected_sources(), true));
         }
 
-        if ((restore_point != null) && (get_view().contains(restore_point))) {
-            set_cursor(restore_point);
-        }
     }
 
     protected virtual void on_edit_title() {


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