Index: src/XMPPDiscoNode.h ================================================================== --- src/XMPPDiscoNode.h +++ src/XMPPDiscoNode.h @@ -73,11 +73,11 @@ * \param name The node's human friendly name * \return A new autoreleased XMPPDiscoNode */ + (instancetype)discoNodeWithJID: (XMPPJID*)JID node: (OFString*)node - name: (OFString*)name; + name: (OFString*)name; /** * \brief Initializes an already allocated XMPPDiscoNode with the specified * JID and node * Index: src/XMPPDiscoNode.m ================================================================== --- src/XMPPDiscoNode.m +++ src/XMPPDiscoNode.m @@ -21,10 +21,11 @@ */ #import "XMPPConnection.h" #import "XMPPIQ.h" #import "XMPPJID.h" +#import "XMPPDiscoEntity.h" #import "XMPPDiscoNode.h" #import "XMPPDiscoIdentity.h" #import "namespaces.h" @implementation XMPPDiscoNode @@ -58,11 +59,12 @@ name: (OFString*)name { self = [super init]; @try { - if (JID == nil) + if ((JID == nil) && + ![self isKindOfClass: [XMPPDiscoEntity class]]) @throw [OFInvalidArgumentException exception]; _JID = [JID copy]; _node = [node copy]; _name = [name copy];