From 681906669c04a127120ffb4401777700caaf1f48 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Wed, 15 May 2019 23:35:15 +0200 Subject: [PATCH] handle missing country --- app/models/funder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/funder.rb b/app/models/funder.rb index b8a2f63f3..3fc01a689 100644 --- a/app/models/funder.rb +++ b/app/models/funder.rb @@ -44,7 +44,7 @@ def self.query(query, options={}) def self.parse_message(id: nil, message: nil) if message["location"].present? c = ISO3166::Country.find_country_by_name(message["location"]) - code = c.alpha2.present? ? c.alpha2 : nil + code = c.present? ? c.alpha2 : nil country = { "code" => code, "name" => message["location"]