mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Added ability to have loop prevention (#44)
* Added ability to have loop prevention * Added ability to have loop prevention --------- Co-authored-by: Peter Phelan <peterphelan@Peters-MacBook-Pro-2.local>
This commit is contained in:
		@@ -120,6 +120,14 @@ Node.prototype.send = function(msg) {
 | 
			
		||||
    var msgSent = false;
 | 
			
		||||
    var node;
 | 
			
		||||
 | 
			
		||||
    if (Number.isInteger(msg.nodeSendCounter)) {
 | 
			
		||||
        msg.nodeSendCounter += 1;
 | 
			
		||||
        if (msg.nodeSendCounter >= msg.MAXIMUM_NODE_SEND_COUNT) {
 | 
			
		||||
            msg.logger.info('Loop Detected, terminating conversation');
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (msg === null || typeof msg === "undefined") {
 | 
			
		||||
        return;
 | 
			
		||||
    } else if (!util.isArray(msg)) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user