Added chunk-check against undefined

release-2.1
Ruakij 3 years ago
parent 10bd72907e
commit 3b10aca352

@ -47,6 +47,12 @@ class PacketStreamFactory extends Transform{
} }
_transform(chunk, encoding, next){ _transform(chunk, encoding, next){
if(!chunk){
const err = "Chunk was invalid!";
logger.error(err);
next(err);
}
let packet = new Packet(); let packet = new Packet();
const lines = chunk.split("\n"); const lines = chunk.split("\n");

Loading…
Cancel
Save