resourcepool / ssdp-client

The most lightweight asynchronous Java SSDP (Simple Service Discovery Protocol) Client
Apache License 2.0
53 stars 21 forks source link

NPE for service announcement #1

Closed hosek closed 6 years ago

hosek commented 7 years ago

Hello, Im getting NPE for some services annoucement/service. Probably some service has null serial number (Im not sure if its mandatory for services to have it), please add null check before checking key in cache. Thank you for nice library! java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:915) at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:943) at io.resourcepool.jarpic.client.SsdpClientImpl.handlePresenceAnnouncement(SsdpClientImpl.java:181) at io.resourcepool.jarpic.client.SsdpClientImpl.handleIncomingPacket(SsdpClientImpl.java:127) at io.resourcepool.jarpic.client.SsdpClientImpl.access$300(SsdpClientImpl.java:29) at io.resourcepool.jarpic.client.SsdpClientImpl$2.run(SsdpClientImpl.java:100) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761)

loicortola commented 6 years ago

Hello @hosek I have noticed this also, some services don't have a serial number. This issue was fixed in release 1.2.0 some time ago. Sorry for the delay of response. Cheers,

Loïc