Skip to content

Commit

Permalink
Don't throw from SqlServerStorage.ToString when using custom factory
Browse files Browse the repository at this point in the history
  • Loading branch information
odinserj committed Nov 20, 2020
1 parent a52890f commit f9497db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Hangfire.SqlServer/SqlServerStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ public override string ToString()

try
{
if (_connectionString == null)
{
return "SQL Server (custom)";
}

var parts = _connectionString.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => x.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries))
.Select(x => new { Key = x[0].Trim(), Value = x[1].Trim() })
Expand Down

0 comments on commit f9497db

Please sign in to comment.