Skip to content

Commit

Permalink
customize.withParent() now handles an undefined-argument gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
nknapp committed Mar 2, 2016
1 parent 9ef95b6 commit 0cdc00a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/withParent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ var _ = require('lodash')
* @param fn
*/
module.exports = function withParent (fn) {
if (_.isUndefined(fn)) {
return fn
}
var result = _.partial(fn)
// Misuse of `_.partial` so that we have dedicated function object on which we can set properties
result._customize_custom_overrider = function (a, b) {
Expand Down

0 comments on commit 0cdc00a

Please sign in to comment.