From 727bbbd216ccd0f4c11164b54348a120f5311d40 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 9 Nov 2015 19:35:41 +0000 Subject: [PATCH] Protect against attribute not being present --- javascript/duktape/dukky.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/duktape/dukky.c b/javascript/duktape/dukky.c index 8c10dcb9f..b65e94b5a 100644 --- a/javascript/duktape/dukky.c +++ b/javascript/duktape/dukky.c @@ -465,7 +465,7 @@ static void dukky_push_handler_code_(duk_context *ctx, dom_string *name, } exc = dom_element_get_attribute(ele, onname, &val); - if (exc != DOM_NO_ERR) { + if ((exc != DOM_NO_ERR) || (val == NULL)) { dom_string_unref(onname); duk_push_lstring(ctx, "", 0); return;