From 11f582cafc8abca5990135a0fe786a4bfe6f7a2a Mon Sep 17 00:00:00 2001 From: Monsta Date: Wed, 21 Jan 2015 14:11:43 +0300 Subject: fix crash when pressing Enter on "unable to open document" screen Closes https://github.com/mate-desktop/atril/pull/124 --- shell/ev-window.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shell/ev-window.c b/shell/ev-window.c index d6b3ef7e..531b54cb 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -3778,8 +3778,9 @@ ev_window_cmd_focus_page_selector (GtkAction *act, EvWindow *window) static void ev_window_cmd_scroll_forward (GtkAction *action, EvWindow *window) { - /*If the webview is occupying the window*/ - if ( window->priv->document->iswebdocument == TRUE) return ; + /* If the webview is occupying the window */ + if (window->priv->document && window->priv->document->iswebdocument == TRUE) + return; ev_view_scroll (EV_VIEW (window->priv->view), GTK_SCROLL_PAGE_FORWARD, FALSE); } @@ -3787,8 +3788,9 @@ ev_window_cmd_scroll_forward (GtkAction *action, EvWindow *window) static void ev_window_cmd_scroll_backward (GtkAction *action, EvWindow *window) { - /*If the webview is occupying the window*/ - if ( window->priv->document->iswebdocument == TRUE ) return ; + /* If the webview is occupying the window */ + if (window->priv->document && window->priv->document->iswebdocument == TRUE) + return; ev_view_scroll (EV_VIEW (window->priv->view), GTK_SCROLL_PAGE_BACKWARD, FALSE); } -- cgit v1.2.1