From c534f284a8b7db51ba1c14f9f696d22860280976 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 2 Apr 2004 23:40:29 +0000 Subject: [project @ 2004-04-02 23:40:29 by jmb] Fix possible crash due to box style being 0. svn path=/import/netsurf/; revision=707 --- desktop/browser.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'desktop/browser.c') diff --git a/desktop/browser.c b/desktop/browser.c index 2413df7aa..c06a6f0d2 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -1382,6 +1382,7 @@ void browser_window_follow_link(struct browser_window *bw, int found, plot_index; int i; int done = 0; + struct css_style *style; gui_pointer_shape pointer = GUI_POINTER_DEFAULT; found = 0; @@ -1399,8 +1400,8 @@ void browser_window_follow_link(struct browser_window *bw, return; for (i = found - 1; i >= 0; i--) { - if (click_boxes[i].box->style->visibility == - CSS_VISIBILITY_HIDDEN) + style = click_boxes[i].box->style; + if (style != 0 && style->visibility == CSS_VISIBILITY_HIDDEN) continue; if (click_boxes[i].box->href != NULL) { char *url = @@ -1511,10 +1512,10 @@ void browser_window_follow_link(struct browser_window *bw, done = 1; break; } - if (click_type == 0 && click_boxes[i].box->style->cursor != CSS_CURSOR_UNKNOWN) { + if (click_type == 0 && style != 0 && + style->cursor != CSS_CURSOR_UNKNOWN && + pointer == GUI_POINTER_DEFAULT) { pointer = get_pointer_shape(click_boxes[i].box->style->cursor); - done = 1; - break; } } -- cgit v1.2.3