title: ReSharper: how to remove "Possible 'System.NullReferenceException'" warning
body: <p>Here is a piece of code:</p>
  
  <pre><code>IUser user = managerUser.GetUserById(UserId);
  if ( user==null ) 
      throw new Exception(...);
  
  Quote quote = new Quote(user.FullName, user.Email);
  </code></pre>
  
  <p>Everything is fine here. But if I replace "if" line with the following one:</p>
  
  <pre><code>ComponentException&lt;MyUserManagerException&gt;.FailIfTrue(user == null, "Can't find user with Id=" + UserId);
  </code></pre>
  
  <p>where function implementation is following:</p>
  
  <pre><code>public abstract class ComponentException&lt;T&gt; : ComponentException
          where T : ComponentException, new()
  {
      public static void FailIfTrue(bool expression, string message)
      {
          if (expression)
          {
              T t = new T();
              t.SetErrorMessage(message);
              throw t;
          }
      }
      //...
  }
  </code></pre>
  
  <p>Then ReSharper generates me a warning: Possible 'System.NullReferenceException' pointing on 1st usage of 'user' object.</p>
  
  <p>Q1. Why it generates such exception? As far as I see if <code>user==null</code> then exception will be generated and execution will never reach the usage point.</p>
  
  <p>Q2. How to remove that warning? Please note:
   1. I don't want to suppress this warning with comments (I will have a lot of similar pieces and don't want to transform my source code in 'commented garbage);
   2. I don't want to changes ReSharper settings to change this problem from warning to 'suggestion' of 'hint'.</p>
  
  <p>Thanks.</p>
  
  <p>Any thoughts are welcome!</p>
  
  <p>P.S. I am using resharper 5.1, MVSV 2008, C#</p>