unclechu / node-deep-extend

Recursive extend module
MIT License
202 stars 53 forks source link

Skip null arguments #29

Closed maxdeviant closed 7 years ago

maxdeviant commented 8 years ago

This fixes a TypeError that is thrown when calling deepExtend with a null argument:

TypeError: Cannot convert undefined or null to object.

undefined was already handled, since typeof undefined is "undefined" and would skip the argument as a result.

typeof null is "object", which was causing Object.keys(obj) to throw the TypeError.

unclechu commented 7 years ago

@maxdeviant merged and released with v0.4.2

maxdeviant commented 7 years ago

@unclechu Great! Thanks so much!