summaryrefslogtreecommitdiff
path: root/internal/db/bundb/account.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-03-10 11:59:55 +0100
committerLibravatar tobi <tobi.smethurst@protonmail.com>2024-03-11 10:52:12 +0100
commit0bd95d7b71ae71d801b0fbb643598eb0ccd1b8f5 (patch)
tree87fbf0b9d8fc158ff4857ad8f407dc47389f2327 /internal/db/bundb/account.go
parent[chore] seperate snapshot from release in goreleaser (#2740) (diff)
downloadgotosocial-0.14.2.tar.xz
[bugfix] Don't error when populating MovedTo if account not found (#2741)v0.14.2
* [bugfix] Don't error when populating MovedTo if account not found * test the thing
Diffstat (limited to 'internal/db/bundb/account.go')
-rw-r--r--internal/db/bundb/account.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/db/bundb/account.go b/internal/db/bundb/account.go
index d2c9c2f51..bf618ef41 100644
--- a/internal/db/bundb/account.go
+++ b/internal/db/bundb/account.go
@@ -305,12 +305,13 @@ func (a *accountDB) PopulateAccount(ctx context.Context, account *gtsmodel.Accou
}
if account.MovedTo == nil && account.MovedToURI != "" {
- // Account movedTo is not set, fetch from database.
+ // Account movedTo is not set, try to fetch from database,
+ // but only error on real errors since this field is optional.
account.MovedTo, err = a.state.DB.GetAccountByURI(
gtscontext.SetBarebones(ctx),
account.MovedToURI,
)
- if err != nil {
+ if err != nil && !errors.Is(err, db.ErrNoEntries) {
errs.Appendf("error populating moved to account: %w", err)
}
}