#22384 added better Null checks.