From 59924a227208dd98a610c29e116f834b3a8ea94b Mon Sep 17 00:00:00 2001 From: Mazarin Date: Thu, 2 Feb 2023 22:21:13 -0500 Subject: [PATCH] fix: fix address pivot (monicahq/chandler#419) --- .../Web/ViewHelpers/ModuleContactAddressesViewHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Domains/Contact/ManageContactAddresses/Web/ViewHelpers/ModuleContactAddressesViewHelper.php b/app/Domains/Contact/ManageContactAddresses/Web/ViewHelpers/ModuleContactAddressesViewHelper.php index e4dd212d72d..088c0c9ca45 100644 --- a/app/Domains/Contact/ManageContactAddresses/Web/ViewHelpers/ModuleContactAddressesViewHelper.php +++ b/app/Domains/Contact/ManageContactAddresses/Web/ViewHelpers/ModuleContactAddressesViewHelper.php @@ -48,7 +48,7 @@ public static function dto(Contact $contact, Address $address, User $user): arra { return [ 'id' => $address->id, - 'is_past_address' => (bool) $address->pivot->is_past_address, + 'is_past_address' => $address->pivot ? (bool) $address->pivot->is_past_address : false, 'line_1' => $address->line_1, 'line_2' => $address->line_2, 'city' => $address->city,