Skip to content

Commit

Permalink
fix: check namespace for null (#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Mar 16, 2022
1 parent 6332e25 commit ca605a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Playwright/Transport/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,11 @@ internal async Task<T> WrapApiCallAsync<T>(Func<Task<T>> 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;
Expand Down

0 comments on commit ca605a3

Please sign in to comment.