Check for handler presence before invoking it
Check for handler presence before invoking it

If a waypoint unmounts another waypoint as part of handling an
onEnter/onLeave, and the two waypoints are attached to the same
scrollable ancestor, we could end up with this error:

  Uncaught TypeError: handlers[index] is not a function

Consider the following example, where the first handler removes the
second:

```js
const a = {}
a.handlers = {
  1: function() {
    delete a.handlers[2];
  },
  2: function() {},
};
Object.keys(a.handlers).forEach(function(index) {
  a.handlers[index]();
});
// => Uncaught TypeError: a.handlers[index] is not a function(…)
```

Adding a guard against undefined handlers fixes the problem. Testing
this turned out to be quite hard, so for now I'm just rolling with a
manual fix.

brigade/react-waypoint,brigade/react-waypoint