[Xfce4-commits] [apps/ristretto] 01/01: Fix SEGFAULT when pressing Delete without shown image

noreply at xfce.org noreply at xfce.org
Wed Oct 5 11:04:12 CEST 2016


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/ristretto.

commit 22dee324cd73d3f98370780908b67fd20fda5009
Author: Igor <f2404 at yandex.ru>
Date:   Wed Oct 5 12:03:22 2016 +0300

    Fix SEGFAULT when pressing Delete without shown image
    
    Fixes https://bugzilla.xfce.org/show_bug.cgi?id=12860
---
 src/main_window.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/main_window.c b/src/main_window.c
index 070b1a3..8e7a7d9 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -3414,7 +3414,7 @@ cb_rstto_main_window_delete (
         RsttoMainWindow *window )
 {
     RsttoFile *file = rstto_image_list_iter_get_file (window->priv->iter);
-    const gchar *file_basename = rstto_file_get_display_name(file);
+    const gchar *file_basename;
     GtkWidget *dialog;
     GdkModifierType state;
     gboolean delete_file = FALSE;
@@ -3422,6 +3422,11 @@ cb_rstto_main_window_delete (
     gchar *prompt = NULL;
     GError *error = NULL;
 
+    if (file == NULL)
+    {
+        return;
+    }
+
     g_return_if_fail (rstto_image_list_get_n_images (window->priv->image_list) > 0);
 
     if (gtk_get_current_event_state (&state))
@@ -3451,6 +3456,7 @@ cb_rstto_main_window_delete (
         }
         else
         {
+            file_basename = rstto_file_get_display_name(file);
             if ( delete_file )
             {
                 prompt = g_strdup_printf( _("An error occurred when deleting image '%s' from disk.\n\n%s"), file_basename, error->message );

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list