From d106b2854f2a7fc403d9152eb8cf69e95305d4ef Mon Sep 17 00:00:00 2001 From: Bernd Schnitzer Date: Fri, 18 Mar 2022 17:36:46 +0100 Subject: [PATCH] Fixes issue: NullReferenceException in Connection.WrapApiCallAsync #2074 --- src/Playwright/Transport/Connection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Playwright/Transport/Connection.cs b/src/Playwright/Transport/Connection.cs index 65aa7c9971..21df2c6794 100644 --- a/src/Playwright/Transport/Connection.cs +++ b/src/Playwright/Transport/Connection.cs @@ -439,7 +439,7 @@ internal async Task WrapApiCallAsync(Func> action, bool isInternal { var sf = st.GetFrame(i); string fileName = sf.GetFileName(); - string cSharpNamespace = sf.GetMethod().ReflectedType.Namespace; + string cSharpNamespace = sf.GetMethod().ReflectedType?.Namespace; bool playwrightInternal = cSharpNamespace != null && (cSharpNamespace == "Microsoft.Playwright" || cSharpNamespace.StartsWith("Microsoft.Playwright.Core", StringComparison.InvariantCultureIgnoreCase) ||