ProtocolLib

3M Downloads

NoSuchElementException Error/Question

xtomyserrax opened this issue ยท 1 comments

commented

Debug paste link: dump link: https://pastebin.com/bkGFPQmA (Server using latest ProtocolLib snapshot version 16)

Description and relevant errors:
Hi how are you? Sorry for bothering but today someone using my plugin sent me this error log, he told me that this is happening like once a day, not something regular and it only happens when a player logs off the server (not everytime, but sometimes). Here is the log: https://pastebin.com/SfqLKQcy

Basicly, I cant replicate this error in my test server but wanted to know if I am missing something in my code or if it could be a bug. My code is this: https://pastebin.com/z09YX0NM and line 58 is:
if (vanishedPlayers.contains(((WrappedGameProfile) iterator.next()).getUUID())) {

I am using ProtocolLib to update server ping list and number, and well it works perfectly except in this case this person reported me.

It would be really helpful if you let me know that I am missing something or to know if this is a bug.

Thank you a lot for your help and patience!

commented

In isolation, the bug is that you're trying to call iterator.next() on an empty iterator. Looking at the code surrounding that, it shouldn't be a problem since you're checking if iterator.hasNext(). Could be a concurrency thing - try making a copy of the list before you do your filtering.