Skip to content

Lightpanda: the headless browser designed for AI and automation

crash: remove Target.sendMessageToTarget session_id assertion

Karl Seguin708835b08b49
diff --git a/src/cdp/domains/target.zig b/src/cdp/domains/target.zig
index e36c67339..703cd3d5f 100644
--- a/src/cdp/domains/target.zig
+++ b/src/cdp/domains/target.zig
@@ -366,8 +366,8 @@ fn sendMessageToTarget(cmd: *CDP.Command) !void {
return error.TargetNotLoaded;
}
- lp.assert(bc.session_id != null, "CDP.target.sendMessageToTarget null session_id", .{});
- if (std.mem.eql(u8, bc.session_id.?, params.sessionId) == false) {
+ const session_id = bc.session_id orelse return error.UnknownSessionId;
+ if (std.mem.eql(u8, session_id, params.sessionId) == false) {
// Is this right? Is the params.sessionId meant to be the active
// sessionId? What else could it be? We have no other session_id.
return error.UnknownSessionId;