small fix

This commit is contained in:
tsmethurst 2021-08-25 13:47:28 +02:00
commit 9b3e17b274

View file

@ -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)
}