Fix #2377: add null check for mAudioOutput in processAudioSegments to prevent NPE when no audio outputs present (#2378)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Uğur Tafralı
2026-07-11 11:06:18 +03:00
committed by GitHub
parent 7cf6974b6b
commit 788d994ad7

View File

@@ -188,6 +188,8 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
audioSegment.decrementConsumerCount();
}
else if(audioSegment.isLinked())
{
if(mAudioOutput != null)
{
mAudioChannelsLock.lock();
@@ -208,9 +210,10 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
}
}
}
}
//Sort audio segments by playback priority and assign to empty audio outputs
if(!mAudioSegments.isEmpty())
if(!mAudioSegments.isEmpty() && mAudioOutput != null)
{
mAudioSegments.sort(mAudioSegmentPrioritySorter);
mAudioChannelsLock.lock();