properly handle id with getElementById

This commit is contained in:
Muki Kiboigo
2026-01-06 22:56:10 -08:00
parent dcde19de3c
commit a18ee895d3

View File

@@ -163,8 +163,8 @@ pub fn createAttributeNS(_: *const Document, namespace: []const u8, name: []cons
}); });
} }
pub fn getElementById(self: *const Document, id_: ?[]const u8) ?*Element { pub fn getElementById(self: *const Document, id: []const u8) ?*Element {
const id = id_ orelse return null; if (id.len == 0) return null;
return self._elements_by_id.get(id); return self._elements_by_id.get(id);
} }