Gravitational lensing will cause a dispersion in the Hubble diagram for high redshift sources. This effect introduces a bias in the cosmological parameter determination using the distance-redshift relation for type Ia supernovae. In this note we show how one can diagnose and correct for this bias when doing precision cosmology with supernovae.