windows: Use nserror reporting rather than always NoMemory

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-02-24 11:57:18 +00:00
parent 56a9a25192
commit 2fa06ed503
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74

View File

@ -1265,6 +1265,7 @@ nsws_window_command(HWND hwnd,
case IDC_MAIN_LAUNCH_URL:
{
nsurl *url;
nserror err;
if (GetFocus() != gw->urlbar)
break;
@ -1274,8 +1275,10 @@ nsws_window_command(HWND hwnd,
SendMessage(gw->urlbar, WM_GETTEXT, (WPARAM)(len + 1), (LPARAM)addr);
NSLOG(netsurf, INFO, "launching %s\n", addr);
if (nsurl_create(addr, &url) != NSERROR_OK) {
win32_warning("NoMemory", 0);
err = nsurl_create(addr, &url);
if (err != NSERROR_OK) {
win32_report_nserror(err, 0);
} else {
browser_window_navigate(gw->bw,
url,