resourcepool / ssdp-client

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

Race condition of setting callback to null (at stop discovery) and handling a response #9

Closed l-jonas closed 5 years ago

l-jonas commented 6 years ago
    java.lang.NullPointerException: Attempt to invoke interface method 'void io.resourcepool.ssdp.model.DiscoveryListener.onServiceDiscovered(io.resourcepool.ssdp.model.SsdpService)' on a null object reference
        at io.resourcepool.ssdp.client.impl.SsdpClientImpl.handleDiscoveryResponse(SsdpClientImpl.java:206)
        at io.resourcepool.ssdp.client.impl.SsdpClientImpl.handleIncomingPacket(SsdpClientImpl.java:129)
        at io.resourcepool.ssdp.client.impl.SsdpClientImpl.access$300(SsdpClientImpl.java:33)
        at io.resourcepool.ssdp.client.impl.SsdpClientImpl$2.run(SsdpClientImpl.java:104)
        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

Thanks,

will publish a fix soon.

loicortola commented 5 years ago

Hello @l-jonas , fixed in future 2.3.0 coming up.