protect against null object versus empty array