mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 07:31:47 +00:00
dom: attr: fix crash w/o parent
This commit is contained in:
@@ -863,6 +863,11 @@ pub fn attributeGetValue(a: *Attribute) !?[]const u8 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn attributeSetValue(a: *Attribute, v: []const u8) !void {
|
pub fn attributeSetValue(a: *Attribute, v: []const u8) !void {
|
||||||
|
// if the attribute has no owner/parent, the function crashes.
|
||||||
|
if (try attributeGetOwnerElement(a) == null) {
|
||||||
|
return DOMError.NotSupported;
|
||||||
|
}
|
||||||
|
|
||||||
const err = attributeVtable(a).dom_attr_set_value.?(a, try strFromData(v));
|
const err = attributeVtable(a).dom_attr_set_value.?(a, try strFromData(v));
|
||||||
try DOMErr(err);
|
try DOMErr(err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user