From 25e85f1429971a13b5f063c65781a73952e0bfcf Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 15:32:34 +0000 Subject: do not add script handler if runtime cannot be initialised --- javascript/jsapi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'javascript/jsapi.c') diff --git a/javascript/jsapi.c b/javascript/jsapi.c index 73153fe09..ef34371d1 100644 --- a/javascript/jsapi.c +++ b/javascript/jsapi.c @@ -38,8 +38,10 @@ void js_initialise(void) rt = JS_NewRuntime(8L * 1024L * 1024L); JSLOG("New runtime handle %p", rt); - /* register script content handler */ - javascript_init(); + if (rt != NULL) { + /* register script content handler */ + javascript_init(); + } } void js_finalise(void) -- cgit v1.2.3