Bug fix: Seg fault - view menu
authorColin Clark <colin.clark@cclark.uk>
Sat, 1 Jan 2022 16:30:57 +0000 (16:30 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sat, 1 Jan 2022 16:30:57 +0000 (16:30 +0000)
If Geeqie is opened with no image displayed, selecting the View menu
will cause a seg fault

src/layout_util.c

index 19a8923..e77b8c0 100644 (file)
@@ -2273,7 +2273,7 @@ static void layout_menu_view_menu_cb(GtkWidget *widget, gpointer data)
                menu_label = g_strdup(gtk_menu_item_get_label(GTK_MENU_ITEM(iter->data)));
                if (g_strcmp0(menu_label, _("Open archive")) == 0)
                        {
-                       if (fd->format_class == FORMAT_CLASS_ARCHIVE)
+                       if (fd && fd->format_class == FORMAT_CLASS_ARCHIVE)
                                {
                                gtk_widget_set_sensitive(GTK_WIDGET(iter->data), TRUE);
                                }