Well, sort of.
While Jupiter does attract asteroids (as I said in an earlier post, some of its moons are probably captured asteroids,) it's actually comets that Jupiter has a tendency to attract as they hurtle towards the sun, acting as a "sweeper" along its orbit. And don't forget about Comet Shoemaker-Levy 9 which broke apart and hit Jupiter in spectacular fashion back in 1994. And, yes, if not for the enormous gravity of Jupiter, the Earth may have been hit quite a bit more than it was, especially after what is know as the heavy bombardment period early in the solar system's formation.
But even without Jupiter, the chances of a comet hitting earth is remote. Sure it has happened a few times over the past 4.5 billion years. But it would be the equivalent of hitting a dime with a BB gun from 5 miles away. It's going to take one hell of a lucky shot. Also, if a comet were to come at us while we were on the opposite side of the sun from Jupiter, then the Jovian gravity wouldn't have any effect on it.
Asteroids are another problem, though. Most of the asteroids in the inner solar system are in the main asteroid belt between Jupiter and Mars. And it is the gravity of Jupiter that has formed the belt and keeps most of the asteroids in place. However, some of them get nudged out of the belt by collisions with each other, sending them in towards the sun. There is a large number of asteroids known as NEOs (Near Earth Objects) which have a chance of hitting Earth. And while they are much slower moving than comets, some of them are large enough and moving fast enough to cause devastating damage should they hit us. In fact, the Jet Propulsion Laboratory has the NEAT (Near Earth Asteroid Tracking) System just for calculating if any of them pose a threat to hitting us. We actually had an asteroid about the size of a house come within the orbit of the moon recently. And it was an asteroid that struck Earth that is thought to have brought about the end of the dinosaurs around 65 millions years ago.