[evince] shell: check type of window/sidebar objects



commit 26364736360e7d1e6bdd16406e0c4e01af9767a0
Author: Ilario Gelmetti <iochesonome gmail com>
Date:   Fri May 29 18:50:48 2020 +0200

    shell: check type of window/sidebar objects
    
    Fixes #1409

 shell/ev-sidebar-thumbnails.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c
index b488dd37..97398bd7 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -1130,7 +1130,10 @@ ev_sidebar_thumbnails_is_two_columns (EvSidebarThumbnails *sidebar)
 
         if (priv->width == 0) {
                 window = gtk_widget_get_toplevel (GTK_WIDGET (sidebar));
-                sidebar_width = ev_window_get_metadata_sidebar_size (EV_WINDOW (window));
+                if (EV_IS_WINDOW (window))
+                        sidebar_width = ev_window_get_metadata_sidebar_size (EV_WINDOW (window));
+                else
+                        sidebar_width = 0;
         } else {
                 sidebar_width = priv->width;
         }


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