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:
parent
fbfcb1957c
commit
fc8c3d4608
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue