current_user can be nil
This commit is contained in:
parent
3eff850336
commit
86c467b2f1
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue