mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-21 03:32:35 +03:00
Element::getAttribute() returns DOMString? which means NULL if none.
This commit is contained in:
parent
f65ea4b096
commit
ee5efa1349
@ -279,9 +279,12 @@ method Element::getAttribute()
|
||||
exc = dom_element_get_attribute(priv->parent.node,
|
||||
attr_name, &attr_value);
|
||||
dom_string_unref(attr_name);
|
||||
if (exc != DOM_NO_ERR) return 0;
|
||||
if (exc != DOM_NO_ERR) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (attr_value == NULL) {
|
||||
duk_push_lstring(ctx, "", 0);
|
||||
duk_push_null(ctx);
|
||||
} else {
|
||||
duk_push_lstring(ctx, dom_string_data(attr_value),
|
||||
dom_string_length(attr_value));
|
||||
|
Loading…
Reference in New Issue
Block a user