diff --git a/internal/processing/timeline.go b/internal/processing/timeline.go index c6d6ca374..6a409a6cc 100644 --- a/internal/processing/timeline.go +++ b/internal/processing/timeline.go @@ -92,6 +92,12 @@ func (p *processor) PublicTimelineGet(ctx context.Context, authed *oauth.Auth, m return nil, gtserror.NewErrorInternalError(err) } + if len(s) == 0 { + return &apimodel.StatusTimelineResponse{ + Statuses: []*apimodel.Status{}, + }, nil + } + return p.packageStatusResponse(s, "api/v1/timelines/public", s[len(s)-1].ID, s[0].ID, limit) } @@ -113,6 +119,12 @@ func (p *processor) FavedTimelineGet(ctx context.Context, authed *oauth.Auth, ma return nil, gtserror.NewErrorInternalError(err) } + if len(s) == 0 { + return &apimodel.StatusTimelineResponse{ + Statuses: []*apimodel.Status{}, + }, nil + } + return p.packageStatusResponse(s, "api/v1/favourites", nextMaxID, prevMinID, limit) }