ARTEMIS-752 fixing NPE

Done as a patch on https://issues.apache.org/jira/browse/ARTEMIS-752
This commit is contained in:
Benjamin Graf 2016-10-05 11:40:07 -04:00 committed by Clebert Suconic
parent cc6ded96d8
commit f8038268e0
1 changed files with 7 additions and 5 deletions

View File

@ -144,11 +144,13 @@ public class OsgiBroker {
private String[] getRequiredProtocols(Set<TransportConfiguration> acceptors) {
ArrayList<String> protocols = new ArrayList<>();
for (TransportConfiguration acceptor : acceptors) {
String protocolsFromAcceptor = acceptor.getParams().get(TransportConstants.PROTOCOLS_PROP_NAME).toString();
String[] protocolsSplit = protocolsFromAcceptor.split(",");
for (String protocol : protocolsSplit) {
if (!protocol.contains(protocol)) {
protocols.add(protocol);
Object protocolsFromAcceptor = acceptor.getParams().get(TransportConstants.PROTOCOLS_PROP_NAME);
if (protocolsFromAcceptor != null) {
String[] protocolsSplit = protocolsFromAcceptor.toString().split(",");
for (String protocol : protocolsSplit) {
if (!protocols.contains(protocol)) {
protocols.add(protocol);
}
}
}
}