fixed delete checking for category on transaction
This commit is contained in:
parent
ad30cf9cd9
commit
dddbb04023
1 changed files with 3 additions and 1 deletions
|
@ -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' );
|
||||
|
|
Reference in a new issue