1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Fix ConnectionConfiguration.getEnabledSaslMechanisms()

in case enabledSaslMechanisms is null, because then unmodifiableSet()
will throw an NPE.

Thanks to Nándor Holozsnyák for reporting.
This commit is contained in:
Florian Schmaus 2017-03-15 21:25:37 +01:00
parent 0a6843f41f
commit 3640339073

View file

@ -472,7 +472,16 @@ public abstract class ConnectionConfiguration {
return enabledSaslMechanisms.contains(saslMechanism); return enabledSaslMechanisms.contains(saslMechanism);
} }
/**
* Return the explicitly enabled SASL mechanisms. May return <code>null</code> if no SASL mechanisms where
* explicitly enabled, i.e. all SALS mechanisms supported and announced by the service will be considered.
*
* @return the enabled SASL mechanisms or <code>null</code>.
*/
public Set<String> getEnabledSaslMechanisms() { public Set<String> getEnabledSaslMechanisms() {
if (enabledSaslMechanisms == null) {
return null;
}
return Collections.unmodifiableSet(enabledSaslMechanisms); return Collections.unmodifiableSet(enabledSaslMechanisms);
} }