Skip to content

Commit

Permalink
fix bug set function with path be undefined or null
Browse files Browse the repository at this point in the history
  • Loading branch information
0xvoidmain committed Dec 8, 2016
1 parent bd737d5 commit fdfd77e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function get(obj, path) {
}

function set(obj, path, value) {
if (path === undefined || path === null) {
return false;
}
var keys = typeof path == 'string' ?
parsePath(path) :
Array.isArray(path) ? path : [path];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deep-obj",
"version": "1.2.1",
"version": "1.2.2",
"description": "Set and get values on objects via dot-notation strings",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit fdfd77e

Please sign in to comment.