From 036689f13f9c2d08a91fdd26b9e8dffd252a7e09 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Fri, 20 Jul 2018 19:04:57 +0200
Subject: Fixed a GTK warning.

---
 src/gui/panels/glance.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/gui/panels/glance.c b/src/gui/panels/glance.c
index 0fb8f43..b7ce9da 100644
--- a/src/gui/panels/glance.c
+++ b/src/gui/panels/glance.c
@@ -319,8 +319,17 @@ static void change_glance_panel_current_view(GGlancePanel *panel, GLoadedPanel *
      * de la fonction mcb_view_change_support().
      */
 
-    parent = gtk_widget_get_parent(GTK_WIDGET(new));
-    if (!GTK_IS_SCROLLED_WINDOW(parent)) return;
+    if (new != NULL)
+    {
+        parent = gtk_widget_get_parent(GTK_WIDGET(new));
+
+        if (!GTK_IS_SCROLLED_WINDOW(parent))
+        {
+            panel->view = NULL;
+            return;
+        }
+
+    }
 
     panel->view = new;
 
-- 
cgit v0.11.2-87-g4458