From fbbfae2d2949cd1a46d06c55a85599e2f71b9247 Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Mon, 14 Sep 2026 17:23:13 +0800 Subject: [PATCH] assert node has a non-null document --- src/browser/webapi/Node.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/browser/webapi/Node.zig b/src/browser/webapi/Node.zig index 2fd8ec394..2bf956a60 100644 --- a/src/browser/webapi/Node.zig +++ b/src/browser/webapi/Node.zig @@ -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