Skip to content

Commit bf11a08

Browse files
Improve null safety in IsAdminContext method
Co-authored-by: michalJakubis <64188398+michalJakubis@users.noreply.github.com>
1 parent cf39ae5 commit bf11a08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Kentico.Xperience.TagManager/Rendering/CodeSnippetTagHelperComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private static bool IsAdminContext(HttpContext? httpContext)
163163
}
164164

165165
var path = httpContext.Request.Path.Value;
166-
return !string.IsNullOrEmpty(path) && path.StartsWith("/cmsctx/", StringComparison.OrdinalIgnoreCase);
166+
return path?.StartsWith("/cmsctx/", StringComparison.OrdinalIgnoreCase) == true;
167167
}
168168

169169
private IHtmlContent GetScriptSrcTag()

0 commit comments

Comments
 (0)