From: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/mshtml/htmlwindow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 6c550172d68..e05dc143c08 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3219,8 +3219,10 @@ static HRESULT check_target_origin(HTMLInnerWindow *window, const WCHAR *target_ goto done; hres = IUri_GetPort(uri, &port); - if(hres != S_OK) + if(hres != S_OK) { + hres = FAILED(hres) ? hres : S_OK; /* some protocols don't have ports (e.g. res) */ goto done; + } hres = IUri_GetPort(target, &port2); if(hres == S_OK && port != port2) hres = S_FALSE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2915