From 14bae8c6c406839d606bc0a79f371e52c3cac779 Mon Sep 17 00:00:00 2001 From: Jim Cowart Date: Wed, 23 May 2012 12:25:35 -0400 Subject: [PATCH] Fixing issue where unsubscribing during a publish operation breaks the iteration of subscription definitions in localBus. --- src/main/LocalBus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/LocalBus.js b/src/main/LocalBus.js index 5de038e..8397855 100644 --- a/src/main/LocalBus.js +++ b/src/main/LocalBus.js @@ -35,7 +35,7 @@ var localBus = { } ); _.each( this.subscriptions[envelope.channel], function ( topic ) { - _.each( topic, function ( subDef ) { + _.each( _.clone(topic), function ( subDef ) { if ( postal.configuration.resolver.compare( subDef.topic, envelope.topic ) ) { if ( _.all( subDef.constraints, function ( constraint ) { return constraint( envelope.data, envelope );