Added chunk-check against undefined
This commit is contained in:
		
							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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user