jin_sample - fixed fail on empty arrays