aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-02-28 16:08:55 +0100
committerXinhui2017-02-28 16:09:01 +0100
commit116687334416da568acc2c0faf0281632ce58e4e (patch)
tree0e0d0aafd684946515b3ed9377295fec8fe29c26
parenta35eab7410b00ab59e42b8e6ccb459b466f9603d (diff)
downloadchouette-core-116687334416da568acc2c0faf0281632ce58e4e.tar.bz2
Fix nil:class error when departure_time is nil
-rw-r--r--app/views/vehicle_journeys/show.rabl4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/vehicle_journeys/show.rabl b/app/views/vehicle_journeys/show.rabl
index ccb55e625..1a2e877ec 100644
--- a/app/views/vehicle_journeys/show.rabl
+++ b/app/views/vehicle_journeys/show.rabl
@@ -30,8 +30,8 @@ child :vehicle_journey_at_stops, :object_root => false do |vehicle_stops|
[:arrival_time, :departure_time].map do |att|
node(att) do |vs|
{
- hour: vs.send(att).strftime('%H'),
- minute: vs.send(att).strftime('%M'),
+ hour: vs.send(att).try(:strftime, '%H'),
+ minute: vs.send(att).try(:strftime, '%M')
}
end
end