Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix assertion in +[A2DynamicDelegate setProtocol:]
Signed-off-by: Alexsander Akers <a2@pandamonia.us>
  • Loading branch information
a2 committed Dec 20, 2011
1 parent 95a529c commit fa8f44a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions A2DynamicDelegate.m
Expand Up @@ -300,10 +300,7 @@ + (Protocol *) protocol
+ (void) setProtocol: (Protocol *) protocol
{
Protocol *existing = objc_getAssociatedObject(self, &A2DynamicDelegateProtocolKey);
NSAlwaysAssert(!existing || !protocol, @"A2DynamicDelegate protocol may only be set once");

if (!protocol)
return;
NSAlwaysAssert(!existing && protocol, @"A2DynamicDelegate protocol may only be set once");

objc_setAssociatedObject(self, &A2DynamicDelegateProtocolKey, protocol, OBJC_ASSOCIATION_ASSIGN);

Expand Down

0 comments on commit fa8f44a

Please sign in to comment.