From 220c267e44987ceeaa99e7b3418b5c32c9048456 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 3 Sep 2015 10:29:12 +0400 Subject: [PATCH] fix loading pty.js in local version --- node_modules/c9/setup_paths.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/node_modules/c9/setup_paths.js b/node_modules/c9/setup_paths.js index e737a890..bad8e241 100644 --- a/node_modules/c9/setup_paths.js +++ b/node_modules/c9/setup_paths.js @@ -13,9 +13,11 @@ modules._resolveFilename = function(request, parent) { // Ensure client extensions can be loaded request = request.replace(/^lib\//, "node_modules/"); // ensure we never use node_modules outside of root dir - parent.paths = parent.paths.filter(function(p) { - return p.indexOf(root) == 0 - }); + if (parent.paths[0] && parent.paths[0].indexOf(root) == 0) { + parent.paths = parent.paths.filter(function(p) { + return p.indexOf(root) == 0; + }); + } // Add the extra paths extraPaths.forEach(function(p) { if (parent.paths.indexOf(p) === -1)