title: Detecting browser language and avoiding nullreference exception
body: <p>I want to detect the browser language so I can switch languages when people connect to my website.
  But when a user hasnt filled in the language in the browsers options I always get a null value with </p>
  
  <pre><code>string browserlanguage = Request.UserLanguages[0]
  </code></pre>
  
  <p>How could I avoid the error "Object reference not set to an instance of an object."</p>