RTP: add a null-check in AudioStream.setDtmfType().
Change-Id: I52cbdea48affae3747942940451f4fd5ca47030f
diff --git a/java/android/net/rtp/AudioStream.java b/java/android/net/rtp/AudioStream.java
index d761214..b7874f7 100644
--- a/java/android/net/rtp/AudioStream.java
+++ b/java/android/net/rtp/AudioStream.java
@@ -158,7 +158,7 @@
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");
}
}