Skip to content

Commit

Permalink
Handle npgsql 8 command null value to fix #174
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeetasse committed Nov 22, 2023
1 parent 00c0f4e commit 3c0b6dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/DistributedLock.Postgres/PostgresAdvisoryLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ private PostgresAdvisoryLock(bool isShared)
return acquireCommandResult switch
{
DBNull _ => Cookie, // indicates we called pg_advisory_lock and not pg_try_advisory_lock
null => Cookie, // Npgsql 8 returns null instead of DBNull
false => null,
true => Cookie,
_ => throw new InvalidOperationException($"Unexpected value '{acquireCommandResult}' from acquire command")
Expand Down

0 comments on commit 3c0b6dc

Please sign in to comment.