mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
assert that nodes exist
This commit is contained in:
@@ -249,8 +249,13 @@ pub const Element = struct {
|
|||||||
// We always get it wrapped like so:
|
// We always get it wrapped like so:
|
||||||
// <html><head></head><body>{ ... }</body></html>
|
// <html><head></head><body>{ ... }</body></html>
|
||||||
// None of the following can be null.
|
// None of the following can be null.
|
||||||
const html = parser.nodeFirstChild(fragment_node).?;
|
const maybe_html = parser.nodeFirstChild(fragment_node);
|
||||||
const body = parser.nodeLastChild(html).?;
|
std.debug.assert(maybe_html != null);
|
||||||
|
const html = maybe_html.?;
|
||||||
|
|
||||||
|
const maybe_body = parser.nodeLastChild(html);
|
||||||
|
std.debug.assert(maybe_body != null);
|
||||||
|
const body = maybe_body.?;
|
||||||
|
|
||||||
const children = try parser.nodeGetChildNodes(body);
|
const children = try parser.nodeGetChildNodes(body);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user