me oh my, i'm just a little guy

This commit is contained in:
tobi 2025-01-08 21:54:02 +01:00
commit 41ceb67acc

View file

@ -389,16 +389,19 @@ func (s *Subscriptions) processDomainPermission(
return false, err return false, err
} }
// True if a perm already exists.
// Note: != nil doesn't work because
// of Go interface idiosyncracies.
existing := !util.IsNil(existingPerm)
if dry { if dry {
// If this is a dry run, return // If this is a dry run, return
// now without doing any DB changes. // now without doing any DB changes.
wouldBeCreated := !covered && existingPerm == nil return !existing, nil
return wouldBeCreated, nil
} }
// Handle perm creation differently depending // Handle perm creation differently depending
// on whether or not a perm already existed. // on whether or not a perm already existed.
existing := !util.IsNil(existingPerm)
switch { switch {
case !existing && *permSub.AsDraft: case !existing && *permSub.AsDraft: