Some testers asks programming questions here when their code throws an exception or performs in a way they did not expect.
As questions on programming they are often considered off-topic.
However, I would consider them on-topic because they relate to a very important skill of a tester: defect isolation. They could be use to teach testers: reading logs, stacktraces, understanding specification (API documentation), debugging and connecting all those sources together. I followed this approach for this question.
So, maybe we should not downvote nor close such questions?