Skip to content

Commit

Permalink
add .try() when force_encoding on user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebaker committed Nov 26, 2013
1 parent e062e06 commit 1b83254
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/munge_and_notify_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def perform
row << ['Hashed IP Address', Digest::MD5.hexdigest([user_session.ip_addr, APP_CONFIG[:IP_ADDR_HASH_SALT]].join(""))]
# we've had some referrers be UTF-8, rest of CSV is ASCII-8BIT
row << ['URL Alias', url_alias.force_encoding('ASCII-8BIT')]
row << ['User Agent', user_session.user_agent.force_encoding('ASCII-8BIT')]
row << ['User Agent', user_session.user_agent.try(:force_encoding, 'ASCII-8BIT')]

# grab most recent referrer from clicks
# that is older than this current vote
Expand Down

0 comments on commit 1b83254

Please sign in to comment.