]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/changeset_controller.rb
Error if geocoder#search is called with no arguments
[rails.git] / app / controllers / changeset_controller.rb
index 38effa14c168cacc0a48bf484b91893dafcb7f95..8a72d941d03752f3c826c4abd4f52ba2c233ae90 100644 (file)
@@ -95,8 +95,10 @@ class ChangesetController < ApplicationController
     lat << cs.max_lat unless cs.max_lat.nil?
 
     # collapse the arrays to minimum and maximum
-    cs.min_lon, cs.min_lat, cs.max_lon, cs.max_lat =
-      lon.min, lat.min, lon.max, lat.max
+    cs.min_lon = lon.min
+    cs.min_lat = lat.min
+    cs.max_lon = lon.max
+    cs.max_lat = lat.max
 
     # save the larger bounding box and return the changeset, which
     # will include the bigger bounding box.
@@ -241,13 +243,9 @@ class ChangesetController < ApplicationController
     changeset = Changeset.find(params[:id])
     new_changeset = Changeset.from_xml(request.raw_post)
 
-    if new_changeset.nil?
-      render :text => "", :status => :bad_request
-    else
-      check_changeset_consistency(changeset, @user)
-      changeset.update_from(new_changeset, @user)
-      render :text => changeset.to_xml, :mime_type => "text/xml"
-    end
+    check_changeset_consistency(changeset, @user)
+    changeset.update_from(new_changeset, @user)
+    render :text => changeset.to_xml, :mime_type => "text/xml"
   end
 
   ##