diff --git a/src/XMPPDiscoNode.h b/src/XMPPDiscoNode.h index adaedaf..d6f7797 100644 --- a/src/XMPPDiscoNode.h +++ b/src/XMPPDiscoNode.h @@ -75,7 +75,7 @@ */ + (instancetype)discoNodeWithJID: (XMPPJID*)JID node: (OFString*)node - name: (OFString*)name; + name: (OFString*)name; /** * \brief Initializes an already allocated XMPPDiscoNode with the specified diff --git a/src/XMPPDiscoNode.m b/src/XMPPDiscoNode.m index 59b1096..913bd10 100644 --- a/src/XMPPDiscoNode.m +++ b/src/XMPPDiscoNode.m @@ -23,6 +23,7 @@ #import "XMPPConnection.h" #import "XMPPIQ.h" #import "XMPPJID.h" +#import "XMPPDiscoEntity.h" #import "XMPPDiscoNode.h" #import "XMPPDiscoIdentity.h" #import "namespaces.h" @@ -60,7 +61,8 @@ self = [super init]; @try { - if (JID == nil) + if ((JID == nil) && + ![self isKindOfClass: [XMPPDiscoEntity class]]) @throw [OFInvalidArgumentException exception]; _JID = [JID copy];