Actor dependencies

's Avatar

james.hay

23 Dec, 2009 02:53 PM

I was trying to unit test a service class which dispatches an event through the Actor's dispatch method. I ended up with a null reference error which i had no idea where it came from. After digging into the class source i found that the dispatch method depends on an evnetDispatcher being set on the Actor.

Could the Actor class either depend on the eventDispatcher upon construction or at the very least have a null reference check and a nicer error message in the dispatch method.

Kind regards
James A Hay

  1. Support Staff 1 Posted by Shaun Smith on 24 Dec, 2009 05:43 PM

    Shaun Smith's Avatar

    Good point! Declaring the dependency via the constructor would muddy
    up derived classes, but a null check could indeed be useful.

  2. Stray closed this discussion on 13 Feb, 2011 06:32 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac