Fix argument checking for XMPPDiscoEntity

This commit is contained in:
Florian Zeitz 2013-07-01 22:07:51 +02:00
parent 9ae39edeb4
commit fac12cfde9
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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];