diff --git a/app/models/incoming_link.rb b/app/models/incoming_link.rb index 9064b0d0d..fd3e9e8e8 100644 --- a/app/models/incoming_link.rb +++ b/app/models/incoming_link.rb @@ -14,7 +14,9 @@ class IncomingLink < ActiveRecord::Base user_id, host, referer = nil current_user = opts[:current_user] - if username = opts[:username] + username = opts[:username] + username = nil unless String === username + if username u = User.select(:id).find_by(username_lower: username.downcase) user_id = u.id if u end