Avoiding NRE when a document that was already deleted is being deleted again