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