Commit 2372de54ac88c470f260c4dd2b100b7e6cc88f0e
1 parent
8716cedc
Exists in
master
and in
1 other branch
add check for nil appearance in api test
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
lib/tasks/test_api.rake
@@ -577,6 +577,7 @@ namespace :test_api do | @@ -577,6 +577,7 @@ namespace :test_api do | ||
577 | 577 | ||
578 | Vote.find_each(:batch_size => 1000, :include => :appearance) do |v| | 578 | Vote.find_each(:batch_size => 1000, :include => :appearance) do |v| |
579 | 579 | ||
580 | + next if v.nil? || v.appearance.nil? | ||
580 | # Subtracting DateTime objects results in the difference in days | 581 | # Subtracting DateTime objects results in the difference in days |
581 | server_response_time = v.created_at.to_f - v.appearance.created_at.to_f | 582 | server_response_time = v.created_at.to_f - v.appearance.created_at.to_f |
582 | if server_response_time < 0 | 583 | if server_response_time < 0 |