This was a very serious problem. There were several variants of inventions that were supposed to eliminate the problem of screw damage. They even thought of installing a metal reflector on the propeller blades, but over time, a synchronizer was invented.
Shooting is synchronized with rotation using a special device. Even Wikipedia says about this: Synchronizer (aviation)