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