I've got this line of code:
if request.user_agent.include?("iPhone") then
But I'm occasionally getting this error:
"undefined method `include?' for nil:NilClass"
When checking logs on the error, there isn't a "HTTP_USER_AGENT
" for the user that is getting the error.
So how can I fix that line so it doesn't throw an error if there isn't an HTTP_USER_AGENT
?