cybertk / ramlev

Validate/Verify examples in RAML
Other
30 stars 5 forks source link

TypeError: Cannot read property 'body' of null #4

Closed cybertk closed 10 years ago

cybertk commented 10 years ago

When executing command ramlev a.raml, it failed with

TypeError: Cannot read property 'body' of null
      at Context.<anonymous> (/Users/quanlong/projects/raml-example-validator/lib/generate-tests.js:67:53)
      at callFn (/Users/quanlong/projects/raml-example-validator/node_modules/mocha/lib/runnable.js:250:21)
      at Test.Runnable.run (/Users/quanlong/projects/raml-example-validator/node_modules/mocha/lib/runnable.js:243:7)
      at Runner.runTest (/Users/quanlong/projects/raml-example-validator/node_modules/mocha/lib/runner.js:373:10)
      at /Users/quanlong/projects/raml-example-validator/node_modules/mocha/lib/runner.js:451:12
      at next (/Users/quanlong/projects/raml-example-validator/node_modules/mocha/lib/runner.js:298:14)
      at /Users/quanlong/projects/raml-example-validator/node_modules/mocha/lib/runner.js:308:7
      at next (/Users/quanlong/projects/raml-example-validator/node_modules/mocha/lib/runner.js:246:23)
      at Object._onImmediate (/Users/quanlong/projects/raml-example-validator/node_modules/mocha/lib/runner.js:275:5)
      at processImmediate [as _immediateCallback] (timers.js:336:15)
cybertk commented 10 years ago

It's caused by these code

seems node.js does not retain the res var passed into function