Commit e8054faf authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

checkout: throw an error when called with empty $station

parent 2e5a1b0a
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -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' );
			}