Fix Attempt to read property "size" on null in AutoPreWarning

This commit is contained in:
Alkl58
2021-12-05 18:13:20 +01:00
committed by GitHub
parent cb0ce6e482
commit c98e7eabf0
+6
View File
@@ -60,6 +60,12 @@ class AutoPreWarning extends Command
->get();
foreach ($prewarn as $pre) {
// Skip Prewarning if Torrent is NULL
// e.g. Torrent has been Rejected by a Moderator after it has been downloaded and not deleted
if (is_null($pre->torrent)) {
continue;
}
if (! $pre->user->group->is_immune && $pre->actual_downloaded > ($pre->torrent->size * (\config('hitrun.buffer') / 100))) {
$exsist = Warning::withTrashed()
->where('torrent', '=', $pre->torrent->id)