Sitelet https://github.com/Free2MoveApp/snipe-it/commit/1bb1f7342f5fd2a27a26ec3c154baca7bd51e0db
Skip to content

Commit 1bb1f73

Browse files
committed
Fixed grokability#6922 - date_add crashing if EOL is null
1 parent 420e8bc commit 1bb1f73

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎app/Presenters/AssetPresenter.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public function fullName()
391391
public function eol_date()
392392
{
393393

394-
if (( $this->purchase_date ) && ( $this->model )) {
394+
if (( $this->purchase_date ) && ( $this->model ) && ($this->model->model->eol) ) {
395395
$date = date_create($this->purchase_date);
396396
date_add($date, date_interval_create_from_date_string($this->model->model->eol . ' months'));
397397
return date_format($date, 'Y-m-d');

0 commit comments

Comments
 (0)