Introduced a workaround for cases where our replacement onclick handler doesn't get a valid event parameter.