From 9b3e17b2742877a8a9f1750ac8f0d9b689b13817 Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Wed, 25 Aug 2021 13:47:28 +0200 Subject: [PATCH] small fix --- internal/processing/timeline.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) }