SI-7128 Fix regression in copyToArray for empty arrays
Merge pull request #2128 from retronym/ticket/7128

SI-7128 Fix regression in copyToArray for empty arrays