# Random ERR\_INVALID\_HANDLE on EventInstance.getParameterByName

**URL:** <https://qa.fmod.com/t/random-err-invalid-handle-on-eventinstance-getparameterbyname/16560>\
**Category:** Unity\
**Tags:** unity\
**Created:** [December 16, 2020, 11:45am UTC](https://qa.fmod.com/t/random-err-invalid-handle-on-eventinstance-getparameterbyname/16560 "2020-12-16T11:45:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![giantdoor](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@giantdoor](https://qa.fmod.com/u/giantdoor)\
**Post date:** [December 16, 2020, 11:45am UTC](https://qa.fmod.com/t/random-err-invalid-handle-on-eventinstance-getparameterbyname/16560/1 "2020-12-16T11:45:51Z")

</div>

I don’t know why, but we get this error every now and then on events that 99.9% of the time work correctly.  
Any idea why that would happen?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [December 18, 2020, 5:24am UTC](https://qa.fmod.com/t/random-err-invalid-handle-on-eventinstance-getparameterbyname/16560/2 "2020-12-18T05:24:45Z")

</div>

It sounds like it’s caused by an invalid event instance, you could add a check before that to make sure the instance is valid before trying to access it. Something like:

```auto
if (EventInstance.isValid())
{
    ...
}

```

---

<div class="post-metadata">

**Author:** ![giantdoor](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@giantdoor](https://qa.fmod.com/u/giantdoor)\
**Post date:** [December 24, 2020, 1:42pm UTC](https://qa.fmod.com/t/random-err-invalid-handle-on-eventinstance-getparameterbyname/16560/3 "2020-12-24T13:42:56Z")

</div>

The thing is, It’s coming when I call Play() on one of the StudioEventEmitter components provided with the Unity integration packages, and it triggers randomly.  
Like, the call works 99% of the times, but sometimes it triggers the error… I tried to read the code and seems like that shouldn’t be the case 😮

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [January 6, 2021, 9:51pm UTC](https://qa.fmod.com/t/random-err-invalid-handle-on-eventinstance-getparameterbyname/16560/4 "2021-01-06T21:51:28Z")

</div>

Are you able to share the logs from when this appears?
