diff options
Diffstat (limited to 'same')
-rw-r--r-- | same/src/main/java/com/orbekk/same/DiscoveryService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/same/src/main/java/com/orbekk/same/DiscoveryService.java b/same/src/main/java/com/orbekk/same/DiscoveryService.java index 0415316..d9af9bb 100644 --- a/same/src/main/java/com/orbekk/same/DiscoveryService.java +++ b/same/src/main/java/com/orbekk/same/DiscoveryService.java @@ -22,6 +22,10 @@ public class DiscoveryService extends Thread { logger.info("DiscoveryService starting."); while (!Thread.interrupted()) { DatagramPacket packet = broadcastListener.listen(); + if (packet == null) { + // An error or interrupt occurred. + continue; + } String content = new String(packet.getData(), 0, packet.getLength()); String[] words = content.split(" "); |