fix problem with blank areas throwing a 500

This commit is contained in:
Richard Fairhurst 2008-03-21 19:49:09 +00:00
parent 7ec9537d58
commit d2c9ea6cf0

View file

@ -123,7 +123,7 @@ class AmfController < ApplicationController
points = nodes_not_used_in_area.collect { |n| [n.id, n.lon_potlatch(baselong,masterscale), n.lat_potlatch(basey,masterscale), n.tags_as_hash] } points = nodes_not_used_in_area.collect { |n| [n.id, n.lon_potlatch(baselong,masterscale), n.lat_potlatch(basey,masterscale), n.tags_as_hash] }
# find the relations used by those nodes and ways # find the relations used by those nodes and ways
relation_ids = Relation.find_for_nodes_and_ways(nodes_in_area.collect {|n| n.id}, way_ids).collect {|n| n.id}.uniq relation_ids = (Relation.find_for_nodes_and_ways(nodes_in_area.collect {|n| n.id}, way_ids)||[]).collect {|n| n.id}.uniq
[way_ids,points,relation_ids] [way_ids,points,relation_ids]
end end