Is it true that Jupiter protects Earth?

Jupiter’s gravity slings long-period comets out of harm’s way, while nudging some asteroids closer to Earth. And, in 1770, Jupiter took aim on Earth – but missed.