Skip to content
This repository
Browse code

add .try() when force_encoding on user-agent

  • Loading branch information...
commit 1b83254365b07a3a0e4e14a7d7b611af9a9d91ee 1 parent e062e06
Luke Baker lukebaker authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  lib/munge_and_notify_job.rb
2  lib/munge_and_notify_job.rb
@@ -144,7 +144,7 @@ def perform
144 144 row << ['Hashed IP Address', Digest::MD5.hexdigest([user_session.ip_addr, APP_CONFIG[:IP_ADDR_HASH_SALT]].join(""))]
145 145 # we've had some referrers be UTF-8, rest of CSV is ASCII-8BIT
146 146 row << ['URL Alias', url_alias.force_encoding('ASCII-8BIT')]
147   - row << ['User Agent', user_session.user_agent.force_encoding('ASCII-8BIT')]
  147 + row << ['User Agent', user_session.user_agent.try(:force_encoding, 'ASCII-8BIT')]
148 148
149 149 # grab most recent referrer from clicks
150 150 # that is older than this current vote

0 comments on commit 1b83254

Please sign in to comment.
Something went wrong with that request. Please try again.