Don't try and look up traces until the user is logged in
[rails.git] / app / controllers / site_controller.rb
index 5d35b9979f113e4a2074095f73ae831bbcdc2614..aa284ecdc100ba37135d7a8e5b9f38db35650218 100644 (file)
@@ -84,7 +84,7 @@ class SiteController < ApplicationController
       @lat = note.lat
       @lon = note.lon
       @zoom = 17
-    elsif params[:gpx]
+    elsif params[:gpx] && @user
       trace = Trace.visible_to(@user).find(params[:gpx])
       @lat = trace.latitude
       @lon = trace.longitude