To test: (as admin)
1. Create a new course.
2. Create a quiz with some questions.
3. Switch role to student.
4. Attempt the quiz.
5. Switch back to your normal role.
6. Go to the quiz reports.
Before the fix, you got a coding_exception thrown. After the fix, you correctly see a blank report. (or that attempt by Admin, if Include is set to 'All attempts', instead of 'all Participants ...'.)