Project: titanium
Issue TIMOB-17951: Calling Ti.Media.switchCamera(undefined) yields unexpected results on devices with 1 or no camera
When Ti.Media.switchCamera(undefined); is called on a device/simulator with zero or one camera, a runtime error is thrown. If Ti.Media.switchCamera(undefined); is called on a device/simulator with two camera's (and one has been opened) then no action is performed and no error occurs. *This is not a regression*. *Steps to reproduce*: 1. Build a project with the attached files, for a device with 1 or no camera 2. Click through the camera test buttons 3. Notice that they correctly open the camera or not, depending on if that camera exists on the device 3. Click on the "Invalid Camera" button 4. Notice that a runtime error is thrown *Expected Result*: No error is thrown and no action is performed (like the camera buttons for unsupported/nonexistent cameras). *Notes*: I was unable to encounter this error on devices with two cameras, despite the same code and 'undefined' parameter passed.
Story points: 3