diff --git a/voip/java/android/net/rtp/AudioStream.java b/voip/java/android/net/rtp/AudioStream.java index d761214d3fd08..b7874f753fde1 100644 --- a/voip/java/android/net/rtp/AudioStream.java +++ b/voip/java/android/net/rtp/AudioStream.java @@ -158,7 +158,7 @@ public class AudioStream extends RtpStream { if (type < 96 || type > 127) { throw new IllegalArgumentException("Invalid type"); } - if (type == mCodec.type) { + if (mCodec != null && type == mCodec.type) { throw new IllegalArgumentException("The type is used by codec"); } }