Don't crash if we can't bind to server socket

This commit is contained in:
Felix Ableitner 2016-09-24 19:03:49 +09:00
parent a857002fa9
commit f579608f6b
1 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,9 @@ class InternetServerThread(crypto: Crypto, port: Int,
}
override def run(): Unit = {
if (socket.isEmpty)
return
try {
while (socket.get.isBound) {
val connection = new InternetConnectionThread(socket.get.accept(), crypto, onDisconnected, onReceive)