aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/workers/route_way_cost_worker.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/workers/route_way_cost_worker.rb b/app/workers/route_way_cost_worker.rb
index b62416c3d..5d8ed52f9 100644
--- a/app/workers/route_way_cost_worker.rb
+++ b/app/workers/route_way_cost_worker.rb
@@ -3,7 +3,11 @@ class RouteWayCostWorker
def perform(referential_id, route_id)
Referential.find(referential_id).switch
- route = Chouette::Route.find(route_id)
+ route = Chouette::Route.where(id: route_id).last
+ unless route.present?
+ Rails.logger.warn "RouteWayCost called on missing route ##{route_id}".red
+ return
+ end
# Prevent recursive worker spawning since this call updates the
# `costs` field of the route.