- distance = format_distance(place.attributes["approxdistance"].to_i)
- direction = format_direction(place.attributes["direction"].to_i)
- placename = place.attributes["name"].to_s
- results.push({:lat => lat, :lon => lon, :zoom => zoom,
- :description => "#{type} #{name}, #{distance} #{direction} of #{placename}"})
+ if place
+ distance = format_distance(place.attributes["approxdistance"].to_i)
+ direction = format_direction(place.attributes["direction"].to_i)
+ placename = place.attributes["name"].to_s
+ results.push({:lat => lat, :lon => lon, :zoom => zoom,
+ :description => "#{type} #{name}, #{distance} #{direction} of #{placename}"})
+ else
+ results.push({:lat => lat, :lon => lon, :zoom => zoom,
+ :description => "#{type} #{name}"})
+ end