]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/traces_controller.rb
Changed User model to not allow nil display_name (w/ tests)
[rails.git] / app / controllers / traces_controller.rb
index c77d884b391d3a237e69b5d2b0d2d0832ed8b898..b78ae295916dce42ef7ca294dec170977e14cdad 100644 (file)
@@ -92,8 +92,8 @@ class TracesController < ApplicationController
   def show
     @trace = Trace.find(params[:id])
 
-    if @trace && @trace.visible? &&
-       (@trace.public? || @trace.user == current_user)
+    if @trace&.visible? &&
+       (@trace&.public? || @trace&.user == current_user)
       @title = t ".title", :name => @trace.name
     else
       flash[:error] = t ".trace_not_found"
@@ -318,7 +318,7 @@ class TracesController < ApplicationController
     visibility = params[:visibility]
 
     if visibility.nil?
-      visibility = if params[:public] && params[:public].to_i.nonzero?
+      visibility = if params[:public]&.to_i&.nonzero?
                      "public"
                    else
                      "private"