From 00f80130c4987d59b87e052fedebcdcd5f94c828 Mon Sep 17 00:00:00 2001 From: Joe Ferner Date: Tue, 24 Jul 2012 14:06:36 -0400 Subject: [PATCH] validate path argument --- serialport.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serialport.js b/serialport.js index 838254d..45e62c9 100644 --- a/serialport.js +++ b/serialport.js @@ -68,6 +68,9 @@ function SerialPort(path, options) { if (FLOWCONTROL.indexOf(options.flowcontrol) == -1) { throw new Error('Invalid "flowcontrol": ' + options.flowcontrol); } + if (!path) { + throw new Error('Invalid port specified: ' + path); + } stream.Stream.call(this);