From 2bf9bfa24ff5a85e27322f921ced5093a311dd73 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Sun, 8 Jan 2023 10:33:03 +0000 Subject: [PATCH] [bugfix] fix panic during status delete loop by breaking out early on len(statuses) == 0 (#1317) Signed-off-by: kim Signed-off-by: kim --- internal/processing/account/delete.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/processing/account/delete.go b/internal/processing/account/delete.go index ca8647933..b06a7b960 100644 --- a/internal/processing/account/delete.go +++ b/internal/processing/account/delete.go @@ -157,6 +157,10 @@ func (p *processor) Delete(ctx context.Context, account *gtsmodel.Account, origi break } + if len(statuses) == 0 { + break // reached end + } + for _, status := range statuses { // Ensure account is set status.Account = account