fix: Fixes NPE on reconnect. #609
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We saw that in the brewery connection, but it can happen and for the client connection to the room.
java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "key" is null
at java.base/java.util.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1111)
at java.base/java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1102)
at org.jivesoftware.smackx.disco.ServiceDiscoveryManager.removeNodeInformationProvider(ServiceDiscoveryManager.java:387)
at net.java.sip.communicator.impl.protocol.jabber.ScServiceDiscoveryManager.stop(ScServiceDiscoveryManager.java:680)
at net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImpl.disconnectAndCleanConnection(ProtocolProviderServiceJabberImpl.java:1529)
at net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImpl.unregisterInternal(ProtocolProviderServiceJabberImpl.java:1581)
at net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImpl.unregisterInternal(ProtocolProviderServiceJabberImpl.java:1559)
at net.java.sip.communicator.impl.protocol.jabber.ProtocolProviderServiceJabberImpl.unregister(ProtocolProviderServiceJabberImpl.java:1541)
at net.java.sip.communicator.plugin.reconnectplugin.PPReconnectWrapper.unregister(PPReconnectWrapper.java:365)
at net.java.sip.communicator.plugin.reconnectplugin.PPReconnectWrapper.reconnect(PPReconnectWrapper.java:348)
at net.java.sip.communicator.plugin.reconnectplugin.PPReconnectWrapper.registrationStateChanged(PPReconnectWrapper.java:219)
Null is EntityCapsManager.currentCapsVersion and that is initialized on any CapabilitiesChanged, and EntityCapsManager always add a feature when enableEntityCaps is called. enableEntityCaps is called before adding the listener for CapabilitiesChanged and the add feature is executed in a blocking thread.