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.
This commit is contained in:
Michael Drake 2017-09-23 16:10:45 +01:00
parent fb4be0feb2
commit 9ca33854bf
1 changed files with 2 additions and 1 deletions

View File

@ -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);