Don't try and look up traces until the user is logged in
authorTom Hughes <tom@compton.nu>
Wed, 11 Jan 2017 21:11:37 +0000 (21:11 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 11 Jan 2017 21:11:37 +0000 (21:11 +0000)
Fixes #1411

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