fix problem with blank areas throwing a 500
authorRichard Fairhurst <richard@systemed.net>
Fri, 21 Mar 2008 19:49:09 +0000 (19:49 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 21 Mar 2008 19:49:09 +0000 (19:49 +0000)
app/controllers/amf_controller.rb

index a2bb1b45433e35a004f7958686a18d761d968c08..aaad3fe11a80dda263f8b6063b2f3778a866cb82 100644 (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] }
 
     # 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]
   end