In theory, if called from the generic export, will be always a proper function.

But, being defensive, better to do as you comment, will go for throwing the exception.

Thanks!