X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FBase.pm;h=152fbb779e3a85699d0ecc4049698321c9451ef6;hb=58fdd50dbb6b909d48b2846f36857b2bd2219441;hp=d50d519b71733c31c2c10d5759b1d52ed953b673;hpb=7b5835061e81d1af578e1572e435d6f3e61d2989;p=kivitendo-erp.git diff --git a/SL/Controller/Base.pm b/SL/Controller/Base.pm index d50d519b7..152fbb779 100644 --- a/SL/Controller/Base.pm +++ b/SL/Controller/Base.pm @@ -174,9 +174,13 @@ sub _dispatch { my $action = first { $::form->{"action_${_}"} } @actions; my $sub = "action_${action}"; - $self->_run_hooks('before', $action); - $self->$sub(@_); - $self->_run_hooks('after', $action); + if ($self->can($sub)) { + $self->_run_hooks('before', $action); + $self->$sub(@_); + $self->_run_hooks('after', $action); + } else { + $::form->error($::locale->text('Oops. No valid action found to dispatch. Please report this case to the Lx-Office team.')); + } } sub _template_obj {