summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar tobi <tobi.smethurst@protonmail.com>2025-10-06 11:45:40 +0200
committerLibravatar tobi <kipvandenbos@noreply.codeberg.org>2025-10-06 11:45:40 +0200
commit03fc6eaf3901d8854f769f2322ea3748abf70c1e (patch)
tree8fdb2ed5e8c42a3c6c527df6c89952ca010f5fa7
parent[docs] Add db migration tip for slow hardware instances. (#4457) (diff)
downloadgotosocial-03fc6eaf3901d8854f769f2322ea3748abf70c1e.tar.xz
[bugfix] Fix nil ptr in `DifferentFrom` func (#4477)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4476 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4477 Co-authored-by: tobi <tobi.smethurst@protonmail.com> Co-committed-by: tobi <tobi.smethurst@protonmail.com>
-rw-r--r--internal/gtsmodel/interactionpolicy.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/gtsmodel/interactionpolicy.go b/internal/gtsmodel/interactionpolicy.go
index 4fa5f4d8e..a7455a108 100644
--- a/internal/gtsmodel/interactionpolicy.go
+++ b/internal/gtsmodel/interactionpolicy.go
@@ -244,6 +244,12 @@ func (pr1 *PolicyRules) DifferentFrom(pr2 *PolicyRules) bool {
return true
}
+ // If they're both nil we don't
+ // need to check anything else.
+ if pr1 == nil && pr2 == nil {
+ return false
+ }
+
// Check if AutomaticApproval
// differs between the two.
if slices.Compare(