Skip to content

Commit cb2e39f

Browse files
fix(compare-dbalogin): add null check after connection attempt
- Add check to skip processing if destServer is null after connection - Prevents null reference errors when destination server connection fails - Improves robustness when connecting to unavailable instances
1 parent 15a082d commit cb2e39f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

public/Compare-DbaLogin.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ function Compare-DbaLogin {
135135
} catch {
136136
Stop-Function -Message "Failure connecting to $destInstance" -Category ConnectionError -ErrorRecord $_ -Target $destInstance -Continue
137137
}
138+
if ($null -eq $destServer) { continue }
138139

139140
$splatGetDest = @{
140141
SqlInstance = $destServer

0 commit comments

Comments
 (0)