handle null and undefineds as keypaths