summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-12-20 16:18:32 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-12-20 16:18:32 +0100
commitebb7c22a4b5c3666e979e14808c3baceb1b631a3 (patch)
tree8af3ee53031c380dfd6deff99e9b294aa763e74e /lib
parent2831fbdfb7d2263f145d5130c8ffb972eca51a9a (diff)
checkin api: only set comment if checkin was successful
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx/Controller/Api.pm2
1 files changed, 1 insertions, 1 deletions
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 );
}