If not executed properly the dumbbell fly compromises the safety of the shoulder joint due to the open-chain nature of the movement which allows for the limbs to move far away from the body.
Using a weight you can handle with good form, keeping the elbows slightly bent, and going too far down are the best tips for preventing an injury.