From 954ace7a7638b273f27cb67f3b7a2cbb4629f339 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Wed, 8 Feb 2012 23:42:09 +0100 Subject: [PATCH] Resolve SIGSEGV in sc_abort --- shortcuts.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/shortcuts.c b/shortcuts.c index 9534c47..217886a 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -23,13 +23,15 @@ sc_abort(girara_session_t* session, girara_argument_t* UNUSED(argument), g_return_val_if_fail(session->global.data != NULL, false); zathura_t* zathura = session->global.data; - for (unsigned int page_id = 0; page_id < zathura->document->number_of_pages; ++page_id) { - zathura_page_t* page = zathura->document->pages[page_id]; - if (page == NULL) { - continue; - } + if (zathura->document != NULL) { + for (unsigned int page_id = 0; page_id < zathura->document->number_of_pages; ++page_id) { + zathura_page_t* page = zathura->document->pages[page_id]; + if (page == NULL) { + continue; + } - g_object_set(page->drawing_area, "draw-links", FALSE, NULL); + g_object_set(page->drawing_area, "draw-links", FALSE, NULL); + } } girara_mode_set(session, session->modes.normal);