From 16fd36eb9d13a71deba2d7a737efa16e1f953138 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 13 Aug 2015 12:23:59 +0100 Subject: Proper error handling for JS context creation. --- desktop/browser.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 18c7fa247..21b6c8815 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -854,11 +854,10 @@ nserror browser_window_initialise_common(enum browser_window_create_flags flags, assert(bw); /* new javascript context for each window/(i)frame */ - bw->jsctx = js_newcontext(nsoption_int(script_timeout), - slow_script, - NULL); - /* If bw->jsctx == NULL, it might be because we built with no JS. - * TODO: Error handling in the with JS case. */ + err = js_newcontext(nsoption_int(script_timeout), + slow_script, NULL, &bw->jsctx); + if (err != NSERROR_OK) + return err; if (flags & BW_CREATE_CLONE) { assert(existing != NULL); -- cgit v1.2.3