summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-09-23 16:10:45 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2017-09-23 16:10:45 +0100
commit9ca33854bf35b46a7796b334ace870029d3e36b9 (patch)
treea155f272c6acb2833eec06300f318678b291933e
parentfb4be0feb2afd8a3d321673c92a5612be570a70a (diff)
downloadnetsurf-9ca33854bf35b46a7796b334ace870029d3e36b9.tar.gz
netsurf-9ca33854bf35b46a7796b334ace870029d3e36b9.tar.bz2
Browser history: Don't segfault when visiting pages with frames.
Core can't make queries of front end about browser windows with no gui window.
-rw-r--r--desktop/browser_history.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop/browser_history.c b/desktop/browser_history.c
index dac9c7671..640302773 100644
--- a/desktop/browser_history.c
+++ b/desktop/browser_history.c
@@ -454,7 +454,8 @@ nserror browser_window_history_update(struct browser_window *bw,
guit->bitmap->render(history->current->page.bitmap, content);
}
- if (guit->window->get_scroll(bw->window, &sx, &sy)) {
+ if (bw->window != NULL &&
+ guit->window->get_scroll(bw->window, &sx, &sy)) {
/* Successfully got scroll offsets, update the entry */
history->current->page.scroll_x = \
(float)sx / (float)content_get_width(content);