Currently every place that calls ShardRegistry::getShard has to check to make sure the pointer it gets back isn't null, and if it is it usually then constructs a Status with the ShardNotFound code to report that. It would be clearer and less error prone if we just returned a StatusWith, making the fact that getShard can fail to actually get a shard explicit, and less likely that a caller forgets to check and accidentally dereferences a null pointer.
- is duplicated by
-
SERVER-21527 Race between remove shard and access to database may cause NULL pointer crash
- Closed
-
SERVER-23739 NULL pointer dereference in PublicGridCommand::_passthrough
- Closed