Does it make sense to check for nullptr in custom deleter of shared_ptr? : <p>I've seen some code that uses <code>std::shared_ptr</code> with a custom deleter that test the argument for nullptr, for example, <code>MyClass</code> which has a <code>close()</code> method and is constructed with some <code>CreateMyClass</code>:</p>

<pre><code>auto pMyClass = std::shared_ptr&lt;MyClass&gt;(CreateMyClass(), 
                                        [](MyClass* ptr)
                                        { 
                                            if(ptr) 
                                                ptr-&gt;close(); 
                                        });
</code></pre>

<p>Does it make sense to test <code>ptr</code> for null-ness in the deleter? 
Can this happen? how?</p>
