A free open source IT asset/license management system
add ternaries
Godfrey M5cb8aae383b4
diff --git a/app/Mail/CheckoutAssetMail.php b/app/Mail/CheckoutAssetMail.phpindex 6886a8741a..a09a40ba8b 100644--- a/app/Mail/CheckoutAssetMail.php+++ b/app/Mail/CheckoutAssetMail.php@@ -37,10 +37,10 @@ class CheckoutAssetMail extends Mailable// Location is a target option, but there are no emails currently associated with locations.if($this->target instanceof User){- $this->target = $this->target->present()->fullName();+ $this->target = $this->target->present()?->fullName();}else if($this->target instanceof Asset){- $this->target = $this->target->assignedto->present()->fullName();+ $this->target = $this->target->assignedto?->present()?->fullName();}$this->last_checkout = '';diff --git a/app/Mail/CheckoutLicenseMail.php b/app/Mail/CheckoutLicenseMail.phpindex eb0bb341b5..bc5259c178 100644--- a/app/Mail/CheckoutLicenseMail.php+++ b/app/Mail/CheckoutLicenseMail.php@@ -31,10 +31,10 @@ class CheckoutLicenseMail extends Mailable$this->target = $checkedOutTo;if($this->target instanceof User){- $this->target = $this->target->present()->fullName();+ $this->target = $this->target?->present()?->fullName();}elseif($this->target instanceof Asset){- $this->target = $this->target->assignedto->present()->fullName();+ $this->target = $this->target->assignedto?->present()?->fullName();}}