That if stmt is not needed, just that I am not sure should i return an empty array of the corresponding type if the array is null?  Like how we do for VARCHAR?  IF so i  can do that and remove this if stmt.
What you feel James?