mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
handle invalid param gracefully
This commit is contained in:
parent
8277a586bb
commit
d676bbc349
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue