1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix wrong type of string being detected by TCPin node

This commit is contained in:
Dave C-J 2013-10-07 16:25:23 +01:00
parent f0f2a71e3a
commit 56476312c1

View File

@ -47,7 +47,7 @@ function TcpIn(n) {
data = data.toString(node.datatype);
}
if (node.stream) {
if ((typeof data) === "string" && node.newline != "") {
if ((node.datatype) === "utf8" && node.newline != "") {
buffer = buffer+data;
var parts = buffer.split(node.newline);
for (var i = 0;i<parts.length-1;i+=1) {
@ -150,4 +150,3 @@ RED.nodes.registerType("tcp in",TcpIn);
TcpIn.prototype.close = function() {
this._close();
}