Fix for the crash reported in bug 116174.

Resolves the bug where the user is using a platform for which the Media Stream InfoBar is not implemented, and where he does not have the requested devices installed on his system (e.g., request for "Video" but the user has no camera).

This fix applies to temporary code which will be removed whenever the InfoBar is implemented on all platforms.

BUG=116174
TEST=

Review URL: http://codereview.chromium.org/9569012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124422 0039d316-1c4b-4281-b951-d872f2087c98
parent 048be3f1
...@@ -1115,7 +1115,8 @@ void ChromeContentBrowserClient::RequestMediaAccessPermission( ...@@ -1115,7 +1115,8 @@ void ChromeContentBrowserClient::RequestMediaAccessPermission(
content::MediaStreamDevices devices; content::MediaStreamDevices devices;
for (content::MediaStreamDeviceMap::const_iterator it = for (content::MediaStreamDeviceMap::const_iterator it =
request->devices.begin(); it != request->devices.end(); ++it) { request->devices.begin(); it != request->devices.end(); ++it) {
devices.push_back(*it->second.begin()); if (!it->second.empty())
devices.push_back(*it->second.begin());
} }
callback.Run(devices); callback.Run(devices);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment