checkout: throw an error when called with empty $station
This commit is contained in:
parent
2e5a1b0a79
commit
e8054faf76
1 changed files with 19 additions and 14 deletions
|
@ -606,6 +606,11 @@ sub startup {
|
||||||
my $user = $self->get_user_status( $uid, $db );
|
my $user = $self->get_user_status( $uid, $db );
|
||||||
my $train_id = $user->{train_id};
|
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} ) {
|
if ( not $user->{checked_in} and not $user->{cancelled} ) {
|
||||||
return ( 0, 'You are not checked into any train' );
|
return ( 0, 'You are not checked into any train' );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue