handle "null-ish" hosts and ports