Skip to content

Commit b39af24

Browse files
authored
Merge pull request #124 from Icinga:fix/mssql_open_connection_empty_db
Fixes MSSQL connection string on empty DB
2 parents a7ea337 + 161fbb5 commit b39af24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mssql/Open-IcingaMSSQLConnection.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function Open-IcingaMSSQLConnection()
6868
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection;
6969
$SqlConnection.ConnectionString = "Server=$Address,$Port;";
7070

71-
if ($null -ne $SqlDatabase) {
71+
if ([string]::IsNullOrEmpty($SqlDatabase) -eq $FALSE) {
7272
$SqlConnection.ConnectionString += "Database=$SqlDatabase;";
7373
}
7474

0 commit comments

Comments
 (0)