title: Why does C# allow you to 'throw null'?
body: <p>While writing some particularly complex exception handling code, someone asked, don't you need to make sure that your exception object isn't null?  And I said, of course not, but then decided to try it.  Apparently, you can throw null, but it is still turned into an exception somewhere.</p>
  
  <p>Why is this allowed?</p>
  
  <pre><code>throw null;
  </code></pre>
  
  <p>In this snippet, thankfully 'ex' is not null, but could it ever be?</p>
  
  <pre><code>try
  {
    throw null;
  }
  catch (Exception ex)
  {
    //can ex ever be null?
  
    //thankfully, it isn't null, but is
    //ex is System.NullReferenceException
  }
  </code></pre>