Skip to content

Commit

Permalink
fix(cdpSession): events without payload (#2913)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Apr 17, 2024
1 parent 05f759f commit 57d81d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Playwright/Core/CDPSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ internal override void OnMessage(string method, JsonElement? serverParams)
switch (method)
{
case "event":
OnCDPEvent(serverParams!.Value.GetProperty("method").ToString(), serverParams.Value.GetProperty("params"));
OnCDPEvent(
serverParams!.Value.GetProperty("method").ToString(),
serverParams!.Value.TryGetProperty("params", out var cdpParams) ? cdpParams : null);
break;
}
}
Expand Down

0 comments on commit 57d81d4

Please sign in to comment.