From 30d1bf6926ac97be8f68f0784969da4c8ce7ad18 Mon Sep 17 00:00:00 2001 From: spiral Date: Tue, 13 Jul 2021 02:31:06 -0400 Subject: [PATCH] Fix WarnOnConflict postgres doesn't like 'value = null' for some reason Closes #223. --- PluralKit.Bot/Commands/MemberProxy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Commands/MemberProxy.cs b/PluralKit.Bot/Commands/MemberProxy.cs index 44873fb8..ab8ff34e 100644 --- a/PluralKit.Bot/Commands/MemberProxy.cs +++ b/PluralKit.Bot/Commands/MemberProxy.cs @@ -34,7 +34,7 @@ namespace PluralKit.Bot async Task WarnOnConflict(ProxyTag newTag) { - var query = "select * from (select *, (unnest(proxy_tags)).prefix as prefix, (unnest(proxy_tags)).suffix as suffix from members where system = @System) as _ where prefix = @Prefix and suffix = @Suffix and id != @Existing"; + var query = "select * from (select *, (unnest(proxy_tags)).prefix as prefix, (unnest(proxy_tags)).suffix as suffix from members where system = @System) as _ where prefix is not distinct from @Prefix and suffix is not distinct from @Suffix and id != @Existing"; var conflicts = (await _db.Execute(conn => conn.QueryAsync(query, new {Prefix = newTag.Prefix, Suffix = newTag.Suffix, Existing = target.Id, system = target.System}))).ToList();