]> git.openstreetmap.org Git - rails.git/commitdiff
Return "404 Not Found" for users and traces which don't exist.
authorTom Hughes <tom@compton.nu>
Thu, 9 Aug 2007 07:45:04 +0000 (07:45 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 9 Aug 2007 07:45:04 +0000 (07:45 +0000)
app/controllers/trace_controller.rb
app/controllers/user_controller.rb

index de8b17f3025c65427f61edfeed9118d855577b8d..b758d0c4044598577c54c14798e722109c9a038a 100644 (file)
@@ -88,6 +88,8 @@ class TraceController < ApplicationController
         render :nothing, :status => :forbidden if @trace.user.id != @user.id
       end
     end
+  rescue ActiveRecord::RecordNotFound
+    render :nothing => true, :status => :not_found
   end
 
   def create
index 0042be316d1cc8e2428d656b348e3dfedf27061a..d945e53a24be6c0a186d346d75715fdb13123e13 100644 (file)
@@ -172,7 +172,12 @@ class UserController < ApplicationController
 
   def view
     @this_user = User.find_by_display_name(params[:display_name])
-    @title = @this_user.display_name
+
+    if @this_user
+      @title = @this_user.display_name
+    else
+      render :nothing => true, :status => :not_found
+    end
   end
 
   def make_friend