title: NullReferenceException using AutoMapper and StructureMap
body: <p>So, I get a NullReferenceException thrown on a production server. It's not reproducible and happens once every ~100 request.</p>
  
  <p>This is the code.</p>
  
  <pre><code>var userInfo = Mapper.Map&lt;UserSubscribedEvent, UserInfo&gt;(userSubscribedEvent);
  var subscription = repository.GetActiveSubscriptionForUser(userInfo.UserId);
  </code></pre>
  
  <p>The exception appears on the second line. So it's either userInfo that is null or it is the repository.</p>
  
  <p>The repository is injected into the class from the constructor using StructureMap so it really should not be null (since it usually works) and userInfo is created using AutoMapper and should not be null either.</p>
  
  <p>So my question is - Can Mapper.Map return null in AutoMapper, if so, when? 
  If not, have anyone experienced that StructureMap randomly injects null dependencies into the constructor? 
  If so, can it be avoided?</p>
  
  <p>Thanks!</p>