diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ad3f719..e298cb0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -35,6 +35,7 @@ def best_deals games.each do |code, games| game = games.first lowest = games.flat_map(&:prices).min_by { |price| price.value.exchange_to('USD') } + next if !lowest.present? rates = currencies.map { |c| lowest.value.exchange_to(c) } rows << [game.title, lowest.country].concat(rates) end