Here is the function and the full error message: [paste function and full stack trace] Explain why this is happening. Then rewrite the function, keeping it efficient and readable. Then write a test that would have caught this bug.Copy