diff --git a/lib/yahoo_weatherman/woeid_lookup.rb b/lib/yahoo_weatherman/woeid_lookup.rb index 29af5f1..d95d3b0 100644 --- a/lib/yahoo_weatherman/woeid_lookup.rb +++ b/lib/yahoo_weatherman/woeid_lookup.rb @@ -10,7 +10,7 @@ def initialize(app_id) def get_woeid(location) raw = get query_string(location) woeid_query = Nokogiri::HTML(raw).at_xpath('.//woeid') - woeid_query ? woeid_query.content : nil + woeid_query.content rescue nil end