From fac12cfde9be4bf0c2fbc3b39f4e103ea7d3271d Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Mon, 1 Jul 2013 22:07:51 +0200 Subject: [PATCH] Fix argument checking for XMPPDiscoEntity --- src/XMPPDiscoNode.h | 2 +- src/XMPPDiscoNode.m | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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];