This appears to be a think-o where the developer was trying to check for a null pointer but was actually checking (redundantly) whether the optional held a valid value or not. We now properly check the pointer for null. This fixes PR51547.