Fixes MSSQL connection string on empty DB

This commit is contained in:
Lord Hepipud 2020-08-28 14:06:47 +02:00
parent a7ea337f6c
commit 161fbb58bc

View file

@ -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;";
}