assert node has a non-null document

This commit is contained in:
Karl Seguin committed 2026-09-14 17:23:13 +08:00
1 parent fa2e21cb57
commit fbbfae2d29
1 file changed
+3 -1
+3 -1
View File
@@ -723,7 +723,9 @@ pub fn getDocument(self: *const Node, frame: *const Frame) *Document {
if (self._type == .document) {
return self.subtype(Document);
}
return self.ownerDocument(frame).?;
const doc = self.ownerDocument(frame);
lp.assert(doc != null, "null node document", .{ .type = self.getNodeType() });
return doc.?;
}
// Returns the Frame that owns this node's tree, or null when the node's