fix reflection check when passed nil