mirror of
				https://github.com/lightpanda-io/browser.git
				synced 2025-10-30 15:41:48 +00:00 
			
		
		
		
	Merge pull request #147 from lightpanda-io/fix-attr-crash
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
	 Pierre Tachoire
					Pierre Tachoire