<p>The crash replicates 100% of the time on my side. All you have to do is to perform <em>insert</em> or <em>remove</em> operations while shutting down the <code>mongod</code>.</p>

<p>The idea behind your patch seems okay. However, I want to make sure we aren't using the driver incorrectly, thus causing this NULL field.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/747#issuecomment-169957259">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciQfKVwoESHYYO1mc7lLXIFiIthy5ks5pX4cQgaJpZM4HAUvK.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/747#issuecomment-169957259"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>