validate type of JS argument and reflect NULL back to caller