Skip to content

Commit e0f6071

Browse files
authored
Avoid NullRef if ResolveLinkTarget returns null (#57235)
1 parent 88b3ebf commit e0f6071

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/FileSystemInfoHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static bool IsExcluded(FileSystemInfo fileSystemInfo, ExclusionFilters fi
5454
try
5555
{
5656
FileSystemInfo targetInfo = fileInfo.ResolveLinkTarget(returnFinalTarget: true);
57-
if (targetInfo.Exists)
57+
if (targetInfo != null && targetInfo.Exists)
5858
{
5959
return targetInfo.LastWriteTimeUtc;
6060
}

0 commit comments

Comments
 (0)