Ball or player touching the referee

As long as the referee believes no advantage has been gained, then play will continue. If he deems an advantage has been gained, then he will order a scrummage.