summaryrefslogtreecommitdiff
path: root/lib/child_process.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/child_process.js')
-rw-r--r--lib/child_process.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/child_process.js b/lib/child_process.js
index 8bcfdf74a0..cef093a0b7 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -111,7 +111,11 @@ function setupChannel(target, channel) {
};
target.send = function(message, sendHandle) {
- if (!target._channel) throw new Error('channel closed');
+ if (typeof message === 'undefined') {
+ throw new TypeError('message cannot be undefined');
+ }
+
+ if (!target._channel) throw new Error("channel closed");
// For overflow protection don't write if channel queue is too deep.
if (channel.writeQueueSize > 1024 * 1024) {