From dddbb04023668402c28d00a9190ea225633ca61c Mon Sep 17 00:00:00 2001 From: Finn Date: Tue, 16 Jan 2018 14:52:16 +0000 Subject: [PATCH] fixed delete checking for category on transaction --- lib/Pear/LocalLoop/Controller/Admin/Transactions.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm index d1e5c0a..084cd99 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Transactions.pm @@ -54,7 +54,9 @@ sub delete { my $id = $c->param('id'); if ( my $transaction = $c->result_set->find($id) ) { - $transaction->category->delete; + if (defined $transaction->category) { + $transaction->category->delete; + } $transaction->delete; $c->flash( success => 'Successfully deleted transaction' ); $c->redirect_to( '/admin/transactions' );