Don't try to get the target node for responder if there is no listener

This can happen in edge cases where he listeners are already
unmounted or not mounted yet or something.
This commit is contained in:
Sebastian Markbage
2016-04-20 03:35:31 +01:00
parent 064092102d
commit 22a8f9964e
@@ -204,7 +204,7 @@ function executeDirectDispatch(event) {
!Array.isArray(dispatchListener),
'executeDirectDispatch(...): Invalid `event`.'
);
event.currentTarget = EventPluginUtils.getNodeFromInstance(dispatchInstance);
event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
var res = dispatchListener ? dispatchListener(event) : null;
event.currentTarget = null;
event._dispatchListeners = null;