Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid a NullPointerException in NetServer.onError #427

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simonlindholm
Copy link

I saw the following stack trace:

Exception in thread "WebsocketSelector14" java.lang.NullPointerException
        at battlecode.server.NetServer.onError(NetServer.java:165)
        at org.java_websocket.server.WebSocketServer.handleFatal(WebSocketServer.java:439)
        at org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:287)
        at java.lang.Thread.run(Thread.java:745)

and indeed the first argument to onError can sometimes be null, so this seems like a reasonable fix.

@jbloxham
Copy link
Contributor

How did you obtain this error? I was able to reproduce this exception by starting two instances of the server simultaneously, but this produces fairly seriously erroneous behavior across the server, and is in general not supported.

@simonlindholm
Copy link
Author

Yeah, I think I got that from running two servers at the same time (trying to parallelize testing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants