From 87389a88ed5889d62ea9b1ee50d5e6ea2fe2e0ac Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Wed, 4 Nov 2015 00:14:14 -0500 Subject: [PATCH] current_user can be nil --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d275eaea..4278637f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -61,6 +61,6 @@ private unsafe_uri = request.env["REQUEST_URI"] valid_url = /^https?:\/\/([\w\.-]+)(:\d{1,5})?\/?$/ safe_uri = (unsafe_uri.match(valid_url)) ? unsafe_uri : "http://metamaps.cc/" - @invite_link = "#{safe_uri}join?code=#{current_user.code}" + @invite_link = "#{safe_uri}join" + (current_user ? "?code=#{current_user.code}" : "") end end