Protect against attribute not being present

This commit is contained in:
Vincent Sanders 2015-11-09 19:35:41 +00:00
parent 125f131714
commit 727bbbd216

View File

@ -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;