From a42dad9c7aded15ae6c928a1f01a09997ad82f49 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 3 Aug 2007 16:51:41 -0700 Subject: [PATCH] Fixing an NSException that was being raised when we try to receive: with a NIL deliverTo * Source/SocketWrapper.m: ([SocketWrapper receive:]): If the client does not specify a selector, do not add it into the userInfo dictionary --- Source/SocketWrapper.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/SocketWrapper.m b/Source/SocketWrapper.m index 1f5417a..607acb3 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -251,9 +251,16 @@ NSString *NsockDataSent = @"SocketWrapper_DataSent"; // convert the NSData into a NSString NSString *string = [[[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding] autorelease]; - [self _postNotification: NsockDataReceived - withObject: string - withDict: [NSMutableDictionary dictionaryWithObject: NSStringFromSelector(selector) forKey: sockNotificationReceiver]]; + if (selector != nil) + { + [self _postNotification: NsockDataReceived + withObject: string + withDict: [NSMutableDictionary dictionaryWithObject: NSStringFromSelector(selector) forKey: sockNotificationReceiver]]; + } + else + { + [self _postNotification: NsockDataReceived withObject: string]; + } } /** -- 2.22.5