Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 5f4c4b9

Browse files
authored
Fix type error when MID is not found in SDP (#555)
1 parent d00f890 commit 5f4c4b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sdk/base/sdputils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,10 @@ function removeCodecFramALine(sdpLines, payload) {
572572
function findMLineRangeWithMID(sdpLines, mid) {
573573
const midLine = 'a=mid:' + mid;
574574
let midIndex = findLine(sdpLines, midLine);
575+
if (midIndex === null) {
576+
Logger.debug('Specified MID is not found');
577+
return null;
578+
}
575579
// Compare the whole line since findLine only compares prefix
576580
while (midIndex >= 0 && sdpLines[midIndex] !== midLine) {
577581
midIndex = findLineInRange(sdpLines, midIndex, -1, midLine);

0 commit comments

Comments
 (0)