diff --git a/src/Playwright/Core/CDPSession.cs b/src/Playwright/Core/CDPSession.cs index 0e2de9dbb4..87c505a07f 100644 --- a/src/Playwright/Core/CDPSession.cs +++ b/src/Playwright/Core/CDPSession.cs @@ -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; } }