racker/node-swiz — pull request #43 by simonvetter (2014-07-29 05:44:59+00:00)
Title: fix(valve): don't crash on null

I came across a case where v.check was being passed null (instead of an object) and had it throw this:
```
node_modules/swiz/lib/valve.js:2205
else if (obj.hasOwnProperty(key)) {
^
TypeError: Cannot call method 'hasOwnProperty' of undefined
at node_modules/swiz/lib/valve.js:2205:18
at node_modules/async/lib/async.js:246:13
at node_modules/async/lib/async.js:131:13
at Object. (node_modules/async/lib/async.js:147:9)
at Object. (node_modules/async/lib/async.js:245:15)
at checkSchema (node_modules/swiz/lib/valve.js:2197:9)
at [object Object].check (node_modules/swiz/lib/valve.js:2364:3)
[...]
```

This changes v.check as well as v.checkPartial to avoid crashing on null/undefined objects.
It also adds tests for both of them.