1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

Check that report shadow copy exists

Check that report shadow copy exists before attempting
to delete it
This commit is contained in:
Leni Kadali 2025-06-17 15:55:00 +03:00
parent fbfcb1957c
commit fc8c3d4608

View file

@ -145,7 +145,7 @@ func RemoveResolvedReports(ctx context.Context, timeout time.Duration) error {
return err return err
} }
if report.ShadowCopyID != 0 { if report.ShadowCopyID.valid && report.ShadowCopyID.Int64 != 0 {
_, err := db.GetEngine(ctx).ID(report.ShadowCopyID).Delete(&moderation.AbuseReportShadowCopy{}) _, err := db.GetEngine(ctx).ID(report.ShadowCopyID).Delete(&moderation.AbuseReportShadowCopy{})
if err != nil { if err != nil {
return err return err