Skip to content

Commit

Permalink
added check in EventHandler to make sure IAsynchronousEvents are actu…
Browse files Browse the repository at this point in the history
…ally being used in a Chain
  • Loading branch information
asstrochris committed Oct 22, 2010
1 parent 7395002 commit 1b7f620
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/org/swizframework/utils/event/EventHandler.as
Expand Up @@ -128,7 +128,7 @@ package org.swizframework.utils.event
throw new Error( "Unable to handle event: " + metadataTag.host.name + "() requires " + getRequiredParameterCount() + " parameters, and no properties were specified." );
}

if( event is IAsynchronousEvent )
if( event is IAsynchronousEvent && IAsynchronousEvent( event ).step != null )

This comment has been minimized.

Copy link
@olimsaidov

olimsaidov Oct 24, 2010

why do we need this?

This comment has been minimized.

Copy link
@johnyanarella

johnyanarella Oct 24, 2010

Member

Do you mean this particular change, or the special handling for IAsynchronousEvent in general?

This particular change was made so that any IAsynchronousEvent dispatched outside the context of an EventChain/EventChainStep can still be mediated without throwing a null pointer exception.

{
if( result is IAsynchronousOperation )
IAsynchronousEvent( event ).step.addAsynchronousOperation( result as IAsynchronousOperation );
Expand Down

0 comments on commit 1b7f620

Please sign in to comment.