Skip to content

Commit 57d81d4

Browse files
authored
fix(cdpSession): events without payload (#2913)
1 parent 05f759f commit 57d81d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Playwright/Core/CDPSession.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ internal override void OnMessage(string method, JsonElement? serverParams)
4545
switch (method)
4646
{
4747
case "event":
48-
OnCDPEvent(serverParams!.Value.GetProperty("method").ToString(), serverParams.Value.GetProperty("params"));
48+
OnCDPEvent(
49+
serverParams!.Value.GetProperty("method").ToString(),
50+
serverParams!.Value.TryGetProperty("params", out var cdpParams) ? cdpParams : null);
4951
break;
5052
}
5153
}

0 commit comments

Comments
 (0)