mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 10:02:24 -05:00
[bugfix] Don't error when populating MovedTo if account not found (#2741)
* [bugfix] Don't error when populating MovedTo if account not found * test the thing
This commit is contained in:
parent
56c7c5dee2
commit
de3c15a425
2 changed files with 14 additions and 2 deletions
|
|
@ -316,12 +316,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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue