From cecb1fd00955ab8670d3099f016eeaa5af663dc5 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 19 Mar 2025 12:06:50 +0100 Subject: [bugfix] Fix set obfuscate = null error in adoptPerm (#3922) * [chore] More tests for domain allow + block subscriptions * [bugfix] Fix set `obfuscate = null` error in adoptPerm * fmt --- internal/subscriptions/domainperms.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal/subscriptions/domainperms.go') diff --git a/internal/subscriptions/domainperms.go b/internal/subscriptions/domainperms.go index b94f284bf..c9f569f94 100644 --- a/internal/subscriptions/domainperms.go +++ b/internal/subscriptions/domainperms.go @@ -19,6 +19,7 @@ package subscriptions import ( "bufio" + "cmp" "context" "encoding/csv" "encoding/json" @@ -869,10 +870,13 @@ func (s *Subscriptions) adoptPerm( perm.SetCreatedByAccount(permSub.CreatedByAccount) // Set new metadata on the perm. - perm.SetObfuscate(obfuscate) perm.SetPrivateComment(privateComment) perm.SetPublicComment(publicComment) + // Avoid trying to blat nil into the db directly by + // defaulting to false if not set on wanted perm. + perm.SetObfuscate(cmp.Or(obfuscate, util.Ptr(false))) + // Update the perm in the db. var err error switch p := perm.(type) { -- cgit v1.2.3