mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-01 01:35:59 +01:00
Fix NPE in ServiceDiscoveryManager
This commit is contained in:
parent
00dd77b346
commit
863d0bf403
2 changed files with 9 additions and 1 deletions
|
@ -162,6 +162,14 @@ public abstract class StanzaBuilder<B extends StanzaBuilder<B>> implements Stanz
|
||||||
return getThis();
|
return getThis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final B addOptExtensions(Collection<? extends ExtensionElement> extensionElements) {
|
||||||
|
if (extensionElements == null) {
|
||||||
|
return getThis();
|
||||||
|
}
|
||||||
|
|
||||||
|
return addExtensions(extensionElements);
|
||||||
|
}
|
||||||
|
|
||||||
public final B addExtensions(Collection<? extends ExtensionElement> extensionElements) {
|
public final B addExtensions(Collection<? extends ExtensionElement> extensionElements) {
|
||||||
for (ExtensionElement extensionElement : extensionElements) {
|
for (ExtensionElement extensionElement : extensionElements) {
|
||||||
addExtension(extensionElement);
|
addExtension(extensionElement);
|
||||||
|
|
|
@ -178,7 +178,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
||||||
// Add node identities
|
// Add node identities
|
||||||
responseBuilder.addIdentities(nodeInformationProvider.getNodeIdentities());
|
responseBuilder.addIdentities(nodeInformationProvider.getNodeIdentities());
|
||||||
// Add packet extensions
|
// Add packet extensions
|
||||||
responseBuilder.addExtensions(nodeInformationProvider.getNodePacketExtensions());
|
responseBuilder.addOptExtensions(nodeInformationProvider.getNodePacketExtensions());
|
||||||
} else {
|
} else {
|
||||||
// Return <item-not-found/> error since specified node was not found
|
// Return <item-not-found/> error since specified node was not found
|
||||||
responseBuilder.ofType(IQ.Type.error);
|
responseBuilder.ofType(IQ.Type.error);
|
||||||
|
|
Loading…
Reference in a new issue