Fixed issue where the returned value could be null instead of the expected empty array when the id list is empty