[project @ 2004-04-02 23:40:29 by jmb]

Fix possible crash due to box style being 0.

svn path=/import/netsurf/; revision=707
This commit is contained in:
John Mark Bell 2004-04-02 23:40:29 +00:00
parent 3e3578d807
commit c534f284a8
1 changed files with 6 additions and 5 deletions

View File

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