Fix JS error in adapter.js for FF for the case when ?transport=xxx is missing in TURN url.

BUG=2737
R=juberti@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/6279004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5331 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
vikasmarwaha@webrtc.org 2013-12-20 22:10:17 +00:00
parent f6acf98a46
commit a63fc87139

View File

@ -47,7 +47,8 @@ if (navigator.mozGetUserMedia) {
// Ignore the transport parameter from TURN url for FF version <=27.
var turn_url_parts = url.split("?");
// Return null for createIceServer if transport=tcp.
if (turn_url_parts[1].indexOf('transport=udp') === 0) {
if (turn_url_parts.length === 1 ||
turn_url_parts[1].indexOf('transport=udp') === 0) {
iceServer = { 'url': turn_url_parts[0],
'credential': password,
'username': username };