From 77e38335bf194d741fb4812a14a1c72c20daa1a5 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Wed, 16 Mar 2022 13:38:42 +1100 Subject: [PATCH] check namespace for null --- src/Playwright/Transport/Connection.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Playwright/Transport/Connection.cs b/src/Playwright/Transport/Connection.cs index 7403654630..65aa7c9971 100644 --- a/src/Playwright/Transport/Connection.cs +++ b/src/Playwright/Transport/Connection.cs @@ -440,7 +440,11 @@ internal async Task WrapApiCallAsync(Func> action, bool isInternal var sf = st.GetFrame(i); string fileName = sf.GetFileName(); string cSharpNamespace = sf.GetMethod().ReflectedType.Namespace; - bool playwrightInternal = cSharpNamespace == "Microsoft.Playwright" || cSharpNamespace.StartsWith("Microsoft.Playwright.Core", StringComparison.InvariantCultureIgnoreCase) || cSharpNamespace.StartsWith("Microsoft.Playwright.Transport", StringComparison.InvariantCultureIgnoreCase) || cSharpNamespace.StartsWith("Microsoft.Playwright.Helpers", StringComparison.InvariantCultureIgnoreCase); + bool playwrightInternal = cSharpNamespace != null && + (cSharpNamespace == "Microsoft.Playwright" || + cSharpNamespace.StartsWith("Microsoft.Playwright.Core", StringComparison.InvariantCultureIgnoreCase) || + cSharpNamespace.StartsWith("Microsoft.Playwright.Transport", StringComparison.InvariantCultureIgnoreCase) || + cSharpNamespace.StartsWith("Microsoft.Playwright.Helpers", StringComparison.InvariantCultureIgnoreCase)); if (string.IsNullOrEmpty(fileName) && !playwrightInternal) { continue;