fixed delete checking for category on transaction

This commit is contained in:
Finn 2018-01-16 14:52:16 +00:00
parent ad30cf9cd9
commit dddbb04023
1 changed files with 3 additions and 1 deletions

View File

@ -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' );