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

NPE after inboundClient.option().removeListener(listener) #41

Open
fa11er opened this issue Dec 12, 2024 · 1 comment
Open

NPE after inboundClient.option().removeListener(listener) #41

fa11er opened this issue Dec 12, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@fa11er
Copy link

fa11er commented Dec 12, 2024

When I delete a listener, I sometimes get a NullPointerException. As I understand it, this happens when the event has already been sent to the listener and he has left at that moment. Is this a bug or is there a safe way to remove the listener?

ERROR - Error caught notifying listener of event [EslEvent: name=[CHANNEL_HANGUP] headers=2, eventHeaders=112, eventBody=0 lines.], remote address [127.0.0.1:8021]
java.lang.NullPointerException: Cannot invoke "link.thingscloud.freeswitch.esl.IEslEventListener.eventReceived(String, link.thingscloud.freeswitch.esl.transport.event.EslEvent)" because "lis
tener" is null
        at link.thingscloud.freeswitch.esl.inbound.AbstractInboundClient.lambda$handleEslEvent$6(AbstractInboundClient.java:222)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at link.thingscloud.freeswitch.esl.inbound.AbstractInboundClient.handleEslEvent(AbstractInboundClient.java:190)
        at link.thingscloud.freeswitch.esl.inbound.NettyInboundClient.handleEslEvent(NettyInboundClient.java:41)
        at link.thingscloud.freeswitch.esl.inbound.handler.InboundChannelHandler.lambda$handleEslEvent$4(InboundChannelHandler.java:174)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:840)
@zhouhailin zhouhailin added the bug Something isn't working label Dec 19, 2024
@zhouhailin zhouhailin self-assigned this Dec 19, 2024
@zhouhailin
Copy link
Owner

fixed in 2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants