handle null values in array of objects