diff --git a/lib/mssql/Open-IcingaMSSQLConnection.psm1 b/lib/mssql/Open-IcingaMSSQLConnection.psm1 index 6ad61f30..cb7617f1 100644 --- a/lib/mssql/Open-IcingaMSSQLConnection.psm1 +++ b/lib/mssql/Open-IcingaMSSQLConnection.psm1 @@ -68,7 +68,7 @@ function Open-IcingaMSSQLConnection() $SqlConnection = New-Object System.Data.SqlClient.SqlConnection; $SqlConnection.ConnectionString = "Server=$Address,$Port;"; - if ($null -ne $SqlDatabase) { + if ([string]::IsNullOrEmpty($SqlDatabase) -eq $FALSE) { $SqlConnection.ConnectionString += "Database=$SqlDatabase;"; }