How to check if module query input is bound before triggering

My module has an input of type query, onOkay.

It’s fired when the Okay btn is pressed in my module’s modal.

The parent app doesn’t always need to make use of this event handler. However, if I do not bind to that query input when using the module, I will always get an error:

In the module, can we conditionally check if the query input has been bound to before attempting to trigger, or catch specific “this isn’t bound” errors? Like so: