Skip to content

Commit

Permalink
Fixed handling for null broadcast scope on unregister
Browse files Browse the repository at this point in the history
  • Loading branch information
mondain authored Aug 1, 2017
1 parent 523a924 commit 6e5d842
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/org/red5/server/stream/ProviderService.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,15 @@ public boolean unregisterBroadcastStream(IScope scope, String name, IBroadcastSt
if (bs != null) {
log.debug("Unsubscribing scope {} from provider {}", broadcastScope, bs.getProvider());
broadcastScope.unsubscribe(bs.getProvider());
}
// if the scope has no listeners try to remove it
if (!((BasicScope) broadcastScope).hasEventListeners()) {
if (log.isDebugEnabled()) {
log.debug("Scope has no event listeners attempting removal");
}
scope.removeChildScope(broadcastScope);
// if the scope has no listeners try to remove it
if (!((BasicScope) broadcastScope).hasEventListeners()) {
if (log.isDebugEnabled()) {
log.debug("Scope has no event listeners attempting removal");
}
scope.removeChildScope(broadcastScope);
}
} else {
log.debug("Broadcast scope was null for {}", name);
}
// verify that scope was removed
return scope.getBasicScope(ScopeType.BROADCAST, name) == null;
Expand Down

0 comments on commit 6e5d842

Please sign in to comment.