Check event handler exists before calling it, in case the cache is out of date. Fixes #442
Merge pull request #444 from shish/check_handler_exists

Check handler exists