Ensure bridges exist when trying to determine bridged parties when publishing transfe...
authorMark Michelson <mmichelson@digium.com>
Thu, 7 Aug 2014 19:44:32 +0000 (19:44 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 7 Aug 2014 19:44:32 +0000 (19:44 +0000)
........

Merged revisions 420387 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420388 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/bridge.c

index 926004b..66c495a 100644 (file)
@@ -3949,8 +3949,12 @@ static void stasis_publish_data_init(struct ast_channel *to_transferee,
                publication->to_transfer_target.bridge = to_target_bridge;
        }
 
-       publication->transferee_channel = ast_bridge_peer(to_transferee_bridge, to_transferee);
-       publication->target_channel = ast_bridge_peer(to_target_bridge, to_transfer_target);
+       if (to_transferee_bridge) {
+               publication->transferee_channel = ast_bridge_peer(to_transferee_bridge, to_transferee);
+       }
+       if (to_target_bridge) {
+               publication->target_channel = ast_bridge_peer(to_target_bridge, to_transfer_target);
+       }
 }
 
 /*