From 07ef2228f832cd77b14140813018ba5a96069453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 27 Apr 2022 12:23:15 +0300 Subject: [PATCH] close #2390 Fixed: Transactions index page broken --- app/Models/Banking/Transaction.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index 36081fa84..b870bc1ea 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -387,18 +387,18 @@ class Transaction extends Model } if ($this->isIncome()) { - if ($this->document->type != 'invoice') { + if (! empty($this->document) && $this->document->type != 'invoice') { return $this->getRouteFromConfig(); } else { - return !empty($this->document_id) ? 'invoices.show' : 'revenues.show'; + return ! empty($this->document_id) ? 'invoices.show' : 'revenues.show'; } } if ($this->isExpense()) { - if ($this->document->type != 'bill') { + if (! empty($this->document) && $this->document->type != 'bill') { return $this->getRouteFromConfig(); } else { - return !empty($this->document_id) ? 'bills.show' : 'payments.show'; + return ! empty($this->document_id) ? 'bills.show' : 'payments.show'; } }