Do not attempt to convert an empty url on RISC OS menu click

When updating the RISC OS frontend to using nsurl for its menu
operations (as part of getting rid of url_nice) the check for
null (empty) url strings in the url under the mouse was omitted
leading to a crash.

Additionaly a use of url where current_menu_url was intended was
missed leading to crashes when "open in new window" was used.
This commit is contained in:
Vincent Sanders 2014-11-01 23:44:41 +00:00
parent cf7abb4a0a
commit 1794ac0d33

View File

@ -2188,7 +2188,9 @@ bool ro_gui_window_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu,
current_menu_main = cont.main; current_menu_main = cont.main;
current_menu_object = cont.object; current_menu_object = cont.object;
nsurl_create(cont.link_url, &current_menu_url); if (cont.link_url != NULL) {
nsurl_create(cont.link_url, &current_menu_url);
}
} }
} }
@ -2819,7 +2821,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
error = browser_window_create( error = browser_window_create(
BW_CREATE_HISTORY | BW_CREATE_HISTORY |
BW_CREATE_CLONE, BW_CREATE_CLONE,
url, current_menu_url,
browser_window_get_url(bw), browser_window_get_url(bw),
bw, bw,
NULL); NULL);