diff --git a/internal/api/client/timelines/public.go b/internal/api/client/timelines/public.go index 0fefe3141..c4ffbc6c8 100644 --- a/internal/api/client/timelines/public.go +++ b/internal/api/client/timelines/public.go @@ -117,12 +117,6 @@ func (m *Module) PublicTimelineGETHandler(c *gin.Context) { authed, err = oauth.Authed(c, false, false, false, false) } else { authed, err = oauth.Authed(c, true, true, true, true) - if authed.Account.IsMoving() { - // For moving/moved accounts, just return - // empty to avoid breaking client apps. - apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONArray) - return - } } if err != nil { @@ -130,6 +124,13 @@ func (m *Module) PublicTimelineGETHandler(c *gin.Context) { return } + if authed.Account != nil && authed.Account.IsMoving() { + // For moving/moved accounts, just return + // empty to avoid breaking client apps. + apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONArray) + return + } + if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil { apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1) return