Console.bnd: Support attempts to log when Window has gone

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-08-01 09:22:09 +01:00
parent 22ee6621fe
commit a325d6b474

View File

@ -51,7 +51,8 @@ write_log_entry(duk_context *ctx, unsigned int group, browser_window_console_fla
duk_size_t msglen;
const char *msg = duk_safe_to_lstring(ctx, 0, &msglen);
if (browser_window_console_log(priv_win->win, BW_CS_SCRIPT_CONSOLE,
if (priv_win == NULL ||
browser_window_console_log(priv_win->win, BW_CS_SCRIPT_CONSOLE,
msg, msglen,
flags) != NSERROR_OK) {
NSLOG(netsurf, DEBUG, "Unable to log: %s", duk_safe_to_string(ctx, 0));