# switchCamera(null) causes an error on Android and crashes on iOS

**URL:** <https://devforum.zoom.us/t/switchcamera-null-causes-an-error-on-android-and-crashes-on-ios/127217>\
**Category:** Flutter\
**Tags:** phone, video-sdk\
**Created:** [February 17, 2025, 6:00am UTC](https://devforum.zoom.us/t/switchcamera-null-causes-an-error-on-android-and-crashes-on-ios/127217 "2025-02-17T06:00:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tihimsm](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tihimsm/32/63057_2.png) [@tihimsm](https://devforum.zoom.us/u/tihimsm)\
**Post date:** [February 17, 2025, 6:00am UTC](https://devforum.zoom.us/t/switchcamera-null-causes-an-error-on-android-and-crashes-on-ios/127217/1 "2025-02-17T06:00:27Z")

</div>

When executing  
`await _zoom.videoHelper.switchCamera(null);`  
the following error occurs:

`PlatformException(ZoomVideoSDK_Error_Invalid_Parameter, deviceId is null or empty, null, null)`

On Android, although an error occurs, the camera still switches.  
On iOS, however, the app crashes.

---

<div class="post-metadata">

**Author:** ![ekaansh.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ekaansh.zoom/32/55004_2.png) [@ekaansh.zoom](https://devforum.zoom.us/u/ekaansh.zoom)\
**Post date:** [April 4, 2025, 10:04am UTC](https://devforum.zoom.us/t/switchcamera-null-causes-an-error-on-android-and-crashes-on-ios/127217/2 "2025-04-04T10:04:54Z")

</div>

Hey @tihimsm, sorry you’re facing this issue. I am able to reproduce this error, we’ll fix this in an upcoming release. In the meantime you can use this workaround:

```auto
final cameras = await zoom.videoHelper.getCameraList();
await zoom.videoHelper.switchCamera(cameras[0].deviceId);

```
