From 33775da6dfba2de2eca4c90e688a821ee1277800 Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Fri, 1 Jun 2012 00:00:31 +1000 Subject: [PATCH] connect using idcorrect DISPLAY --- lib/x11/xcore.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/x11/xcore.js b/lib/x11/xcore.js index 2206acb..bb96846 100644 --- a/lib/x11/xcore.js +++ b/lib/x11/xcore.js @@ -353,6 +353,9 @@ module.exports.createClient = function(initCb, display, options) display = ':0'; var displayMatch = display.match(/^(?:[^:]*?\/)?(.*):(\d+)(?:.(\d+))?$/); + if (!displayMatch) + throw new Error("Cannot parse display"); + var host = displayMatch[1]; if (!host) host = '127.0.0.1';