flatiron/director — pull request #217 by steveluscher (2014-01-13 07:23:53+00:00)
Title: Protect against exception when onpopstate/onhashchange are null

Without this patch, the following will throw an exception:

router = Router(routes)
router.configure({
notfound: function() { router.setRoute('/'); }
});
router.init();

In the early stages of page load, `window.onpopstate` and `window.onhashchange` are `null` (in Chrome, anyway).