Skip to content

Commit eaf5c6f

Browse files
cdp: ensure method action is present
Signed-off-by: Francis Bouvier <[email protected]>
1 parent 0d89b98 commit eaf5c6f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/cdp/cdp.zig

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,17 @@ pub fn do(
102102
return error.UnknonwDomain;
103103

104104
// select corresponding domain
105+
const action = iter.next() orelse return error.BadMethod;
105106
return switch (domain) {
106-
.Browser => browser(alloc, id, iter.next().?, &scanner, ctx),
107-
.Target => target(alloc, id, iter.next().?, &scanner, ctx),
108-
.Page => page(alloc, id, iter.next().?, &scanner, ctx),
109-
.Log => log(alloc, id, iter.next().?, &scanner, ctx),
110-
.Runtime => runtime(alloc, id, iter.next().?, &scanner, s, ctx),
111-
.Network => network(alloc, id, iter.next().?, &scanner, ctx),
112-
.Emulation => emulation(alloc, id, iter.next().?, &scanner, ctx),
113-
.Fetch => fetch(alloc, id, iter.next().?, &scanner, ctx),
114-
.Performance => performance(alloc, id, iter.next().?, &scanner, ctx),
107+
.Browser => browser(alloc, id, action, &scanner, ctx),
108+
.Target => target(alloc, id, action, &scanner, ctx),
109+
.Page => page(alloc, id, action, &scanner, ctx),
110+
.Log => log(alloc, id, action, &scanner, ctx),
111+
.Runtime => runtime(alloc, id, action, &scanner, s, ctx),
112+
.Network => network(alloc, id, action, &scanner, ctx),
113+
.Emulation => emulation(alloc, id, action, &scanner, ctx),
114+
.Fetch => fetch(alloc, id, action, &scanner, ctx),
115+
.Performance => performance(alloc, id, action, &scanner, ctx),
115116
};
116117
}
117118

0 commit comments

Comments
 (0)