checkout: throw an error when called with empty $station

This commit is contained in:
Daniel Friesel 2021-12-12 17:13:51 +01:00
parent 2e5a1b0a79
commit e8054faf76

View file

@ -606,6 +606,11 @@ sub startup {
my $user = $self->get_user_status( $uid, $db );
my $train_id = $user->{train_id};
if ( not $station ) {
$self->app->log->error("Checkout($uid): station is empty");
return ( 1, 'BUG: Checkout station is empty.' );
}
if ( not $user->{checked_in} and not $user->{cancelled} ) {
return ( 0, 'You are not checked into any train' );
}