Skip to content

Commit

Permalink
ref: Adds null check guard.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpolitis committed Jun 11, 2018
1 parent 18ed71b commit 92ed66c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/org/jitsi/videobridge/VideoChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ private static synchronized RecurringRunnableExecutor getRecurringExecutor()
protected void maybeStartStream()
throws IOException
{
boolean previouslyStarted = getStream().isStarted();
MediaStream stream = getStream();
boolean previouslyStarted
= stream != null ? stream.isStarted() : false;

super.maybeStartStream();

// If a recvonly channel is created, existing streams won't be
Expand All @@ -290,7 +293,11 @@ protected void maybeStartStream()
// the bitrate controller when the stream starts which will request a
// keyframe from other channels if needed.

if(getStream().isStarted() && !previouslyStarted)
stream = getStream();
boolean currentlyStarted
= stream != null ? stream.isStarted() : false;

if (currentlyStarted && !previouslyStarted)
{
bitrateController.update(null, -1);
}
Expand Down

0 comments on commit 92ed66c

Please sign in to comment.