From 92ed66c06ef496b3b5f70556f8d013a225575067 Mon Sep 17 00:00:00 2001 From: George Politis Date: Mon, 11 Jun 2018 10:51:17 -0500 Subject: [PATCH] ref: Adds null check guard. --- src/main/java/org/jitsi/videobridge/VideoChannel.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jitsi/videobridge/VideoChannel.java b/src/main/java/org/jitsi/videobridge/VideoChannel.java index 5441a776bd..1f50bbf9f6 100644 --- a/src/main/java/org/jitsi/videobridge/VideoChannel.java +++ b/src/main/java/org/jitsi/videobridge/VideoChannel.java @@ -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 @@ -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); }