Reputation: 430
I have the following weird error; An exception thrown on the empty Catch block!
Any ideas how this is possible and how to fix it?
Thanks!
Upvotes: 0
Views: 196
Reputation: 430
Ok, i think i got it...
For Each mediaPlayerID In _attachedDevices.Values.GroupBy(Function(t)t.MediaPlayerInfo.ID).Distinct()
Try
fileSystemPerMediaPlayerId.Add(mediaPlayerID.Key, New FileSystemOnDevice())
Catch
End Try
Next
The problem is caused by a null variable in the lambda expression inside the GroupBy method...
The compiler just pointed the wrong line..
Upvotes: 1
Reputation: 5104
It tried and failed, but there was nothing in the catch to handle it, hence the error NullReferenceException was unhandled
.
Upvotes: 2