Skip to content

Commit

Permalink
Fix bug with NULL authLocation on unknown site location
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaulson45 committed Dec 21, 2023
1 parent 8cedc50 commit deb8ca3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Diagnostics/HealthChecker/Analyzer/Get-IISAuthenticationType.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@ function Get-IISAuthenticationType {
}
} else {
Write-Verbose "authLocation was NULL, but shouldn't be a problem we just use the parent."
$index = $currentKey.LastIndexOf("/")

if ($index -eq -1) {
$continue = $false
Write-Verbose "No parent location. Need to determine how to address."
$getIisAuthenticationType[$failedKey].Add($appKey)
} else {
$currentKey = $currentKey.Substring(0, $index)
}
}
} elseif ($currentKey -ne $appKey) {
# If we are at a parent location we might not have all the locations in the config. So this could be okay.
Expand All @@ -196,6 +205,7 @@ function Get-IISAuthenticationType {
if ($index -eq -1) {
Write-Verbose "Didn't have root parent in the config file, this is odd."
$getIisAuthenticationType[$failedKey].Add($appKey)
$continue = $false
} else {
$currentKey = $currentKey.Substring(0, $index)
}
Expand Down

0 comments on commit deb8ca3

Please sign in to comment.