Fix for setting delegate to nil

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8070 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-11-09 05:03:42 +00:00
parent 9463d22510
commit 543624301e
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2000-11-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPort.m: ([-setDelegate:]) corrected assertion to allow
delegate to be set to nil. Bug reported by cornils@mail.desy.de
2000-11-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSString.m: ([GSMutableString substringWithRange:]) fix to

View file

@ -169,7 +169,8 @@ Class NSPort_concrete_class;
- (void) setDelegate: (id) anObject
{
NSAssert([anObject respondsToSelector: @selector(handlePortMessage:)],
NSAssert(anObject == nil
|| [anObject respondsToSelector: @selector(handlePortMessage:)],
NSInvalidArgumentException);
_delegate = anObject;
}