Skip to content

Commit

Permalink
fix(enhanceElement): handle undefined callbacks gracefully
Browse files Browse the repository at this point in the history
* fix Google Maps exception when passing undefined callbacks using _.isFunction

- Original author: @aaaristo 
- Original commits: 82b25ca, 7991e59
  • Loading branch information
aaaristo authored and oshalygin committed Aug 1, 2017
1 parent ce6d359 commit e463df3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/enhanceElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function registerGoogleEventsFromReactProps(
eventMap: Object
) {
const registered = _.reduce(eventMap, (acc, googleEventName, onEventName) => {
if (_.has(props, onEventName)) {
if (_.isFunction(props[onEventName])) {
acc.push(
google.maps.event.addListener(instance, googleEventName, props[onEventName])
);
Expand Down

0 comments on commit e463df3

Please sign in to comment.