Commit 23e510a3 authored by Eric Gregory's avatar Eric Gregory

3755 crash while deleting last photo in fullscreen mode

parent 0f7975db
......@@ -161,6 +161,10 @@ public class FullscreenWindow : PageWindow {
AppWindow.get_instance().end_fullscreen();
}
public void close() {
on_close();
}
public override void destroy() {
Page? page = get_current_page();
clear_current_page();
......
......@@ -1190,7 +1190,8 @@ public abstract class EditingHostPage : SinglePhotoPage {
zoom_slider.set_value(0.0);
zoom_slider.value_changed.connect(on_zoom_slider_value_changed);
set_zoom_state(ZoomState(get_photo().get_dimensions(), get_surface_dim(), 0.0));
if (get_photo() != null)
set_zoom_state(ZoomState(get_photo().get_dimensions(), get_surface_dim(), 0.0));
// when cancelling zoom, panning becomes impossible, so set the cursor back to
// a left pointer in case it had been a hand-grip cursor indicating that panning
......@@ -2900,9 +2901,13 @@ public class LibraryPhotoPage : EditingHostPage {
on_next_photo();
// this indicates there is only one photo in the controller, or about to be zero, so switch
// to the Photos page, which is guaranteed to be there when this disappears
if (photo.equals(get_photo()))
// to the library page, which is guaranteed to be there when this disappears
if (photo.equals(get_photo())) {
if (get_container() is FullscreenWindow)
((FullscreenWindow) get_container()).close();
LibraryWindow.get_app().switch_to_library_page();
}
get_command_manager().execute(new TrashUntrashPhotosCommand(photos, true));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment