debugger: guard against call from non-node context
authorBen Noordhuis <info@bnoordhuis.nl>
Thu, 17 Dec 2015 11:13:11 +0000 (12:13 +0100)
committerMyles Borins <mborins@us.ibm.com>
Mon, 15 Feb 2016 19:30:23 +0000 (11:30 -0800)
commit667f7a7ab3976212401924b85f4b2e980f20ca75
treeb933d35b36ff340d17052b0fec2052c3d11ec304
parentc41ed59dbcf63e7679abf69cfa01cde484fcd2a7
debugger: guard against call from non-node context

Fix a segmentation fault when the debug message handler was called from
a context without an associated `node::Environment`.

Fixes: https://github.com/nodejs/node/issues/4261
Fixes: https://github.com/nodejs/node/issues/4322
PR-URL: https://github.com/nodejs/node/pull/4328
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
src/debug-agent.cc
test/parallel/test-debug-no-context.js [new file with mode: 0644]