string cSharpNamespace = sf.GetMethod().ReflectedType.Namespace;
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));
string cSharpNamespace = sf.GetMethod().ReflectedType?.Namespace;
Context:
Related pull request
check namespace for null #2067
Describe the bug
If ReflectedType is null a NullReferenceException is thrown
Line in question at https://github.com/microsoft/playwright-dotnet/blob/main/src/Playwright/Transport/Connection.cs#L442
Fix