# Cannot read properties of undefined (reading 'userRole')

**URL:** <https://devforum.zoom.us/t/cannot-read-properties-of-undefined-reading-userrole/102148>\
**Category:** Video SDK\
**Tags:** video-sdk\
**Created:** [January 19, 2024, 8:42am UTC](https://devforum.zoom.us/t/cannot-read-properties-of-undefined-reading-userrole/102148 "2024-01-19T08:42:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shi88.andy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shi88.andy/32/55545_2.png) [@shi88.andy](https://devforum.zoom.us/u/shi88.andy)\
**Post date:** [January 19, 2024, 8:42am UTC](https://devforum.zoom.us/t/cannot-read-properties-of-undefined-reading-userrole/102148/1 "2024-01-19T08:42:14Z")

</div>

This error happens to me intermittently when leaving the call  
`Cannot read properties of undefined (reading 'userRole')`, not 100% sure about the pattern yet, but it usually happens when another party is leaving the call unexpectedly

I have put `.catch()` on all of my `zoomClient.leave()` call, but still it’s still shown as uncaught error

tested on:

- Brave browser on mac air m1, and mac pro m1

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [January 19, 2024, 1:07pm UTC](https://devforum.zoom.us/t/cannot-read-properties-of-undefined-reading-userrole/102148/2 "2024-01-19T13:07:59Z")

</div>

Hey @shi88.andy

Thanks for your feedback.

It might be because the user has left the session, but there are still places calling Video SDK methods, leading to failed calls. This won’t affect the functionality, and we will strengthen the API call protection in the next version.

Thanks  
Vic
