From ebb7c22a4b5c3666e979e14808c3baceb1b631a3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 20 Dec 2019 16:18:32 +0100 Subject: checkin api: only set comment if checkin was successful --- lib/Travelynx/Controller/Api.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/Travelynx/Controller') diff --git a/lib/Travelynx/Controller/Api.pm b/lib/Travelynx/Controller/Api.pm index f541c98..f5ea3e4 100755 --- a/lib/Travelynx/Controller/Api.pm +++ b/lib/Travelynx/Controller/Api.pm @@ -282,7 +282,7 @@ sub travel_v1 { my ( $train, $error ) = $self->checkin( $from_station, $train_id, $uid ); - if ( $payload->{comment} ) { + if ( $payload->{comment} and not $error ) { $self->update_in_transit_comment( sanitize( q{}, $payload->{comment} ), $uid ); } -- cgit v1.2.3