diff --git a/Changelog b/Changelog index 627f77603..f35b436ca 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-01-26 DariusIII + * Chg: Try to prevent Carbon date errors when postdate is, for some weird reason, null * Chg: Fix wrong NN_INSTALLER constant usage in User model * Chg: Update nikic/php-parser to latest version * Chg: Use artisan console to reset database, update reset_truncate script to use Eloquent and query builder diff --git a/nntmux/processing/PostProcess.php b/nntmux/processing/PostProcess.php index d9e65c8e3..71cd169f0 100755 --- a/nntmux/processing/PostProcess.php +++ b/nntmux/processing/PostProcess.php @@ -350,7 +350,7 @@ class PostProcess if ($filesAdded < 11 && ReleaseFile::query()->where(['releases_id' => $relID, 'name' => $file['name']])->first() === null) { // Try to add the files to the DB. - if (ReleaseFile::addReleaseFiles($relID, $file['name'], $file['hash_16K'], $file['size'], Carbon::createFromFormat('Y-m-d H:i:s', $query['postdate']), 0)) { + if (ReleaseFile::addReleaseFiles($relID, $file['name'], $file['hash_16K'], $file['size'], $query['postdate'] !== null ? Carbon::createFromFormat('Y-m-d H:i:s', $query['postdate']) : Carbon::now(), 0)) { $filesAdded++; } }