mshtml: Correctly handle S_OK with NULL URL return from TranslateUrl.

This commit is contained in:
Jacek Caban 2015-02-25 12:59:20 +01:00 committed by Alexandre Julliard
parent 0200ee838d
commit 203c47e604
2 changed files with 7 additions and 1 deletions

View File

@ -2324,7 +2324,7 @@ static HRESULT translate_uri(HTMLOuterWindow *window, IUri *orig_uri, BSTR *ret_
hres = IDocHostUIHandler_TranslateUrl(window->doc_obj->hostui, 0, display_uri,
&translated_url);
if(hres == S_OK) {
if(hres == S_OK && translated_url) {
TRACE("%08x %s -> %s\n", hres, debugstr_w(display_uri), debugstr_w(translated_url));
SysFreeString(display_uri);
hres = create_uri(translated_url, 0, &uri);

View File

@ -2614,6 +2614,12 @@ static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface, D
ok(ppchURLOut != NULL, "ppchURLOut == NULL\n");
ok(!*ppchURLOut, "*ppchURLOut = %p\n", *ppchURLOut);
/* Not related to hash navigation, just return NULL and S_OK in some cases. */
if(loading_hash) {
*ppchURLOut = NULL;
return S_OK;
}
return S_FALSE;
}