CSHARP-797: Add redundant null checks to satisfy code reviewer.