Make sure the category child ids are an array before iterating.