mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-05 02:05:28 +00:00
add null checks to target
This commit is contained in:
@ -24,6 +24,7 @@ class CheckoutAssetMail extends Mailable
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct(Asset $asset, $checkedOutTo, User $checkedOutBy, $acceptance, $note, bool $firstTimeSending = true)
|
||||
{
|
||||
@ -37,10 +38,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 = '';
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user