validate path argument

This commit is contained in:
Joe Ferner 2012-07-24 14:06:36 -04:00
parent 82b6b95212
commit 00f80130c4

View file

@ -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);