From 326ba25451d41adced0f9e9f43b35dc422451dd7 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 10 Oct 2011 15:37:07 +0200 Subject: [PATCH] tty: unbreak --use-legacy Fixes #1844. --- src/node.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/node.js b/src/node.js index 023132f3030..9e6c77dae02 100644 --- a/src/node.js +++ b/src/node.js @@ -231,7 +231,9 @@ // Hack to have stdout not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 - stdout._handle.unref(); + if (stdout._handle && stdout._handle.unref) { + stdout._handle.unref(); + } break; case 'FILE': @@ -253,7 +255,9 @@ // FIXME Hack to have stdout not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 - stdout._handle.unref(); + if (stdout._handle && stdout._handle.unref) { + stdout._handle.unref(); + } break; default: