All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The Hadeeth: “There is neither harm nor reciprocal harm.”, is a well-known Hadeeth among the scholars and it is an Islamic basis from the succinct and eloquent speeches of the Prophet . It was reported by Malik in Al-Muwatta’, Al-Hakim in Al-Mustadrak, and others, and many scholars have authenticated it.
Al-Hakim said:
“This is a Saheeh Hadeeth with a chain of transmission according to the conditions set by Muslim, but it was not reported by Al-Bukhari and Muslim.” [End of quote]
Adh-Dhahabi said in at-Talkhees: “It fulfills the conditions set by Muslim.”
Several meanings have been mentioned about the interpretation of the Hadeeth, all of which are correct and included in the Hadeeth.
Al-Hafith Ibn Rajab from the Hanbali School of jurisprudence, summarized these meanings in Jaami’ al-‘Uloom wal-Hikam, as he said: “The meaning is that الضَّرَرُ the harm itself is prohibited in the Sharee’ah, as well as causing harm to others without right.
It was also said: “الضَّرَرُ Harm: means to cause harm to others in what benefits the person himself. الضِّرَارُ Reciprocal harm: means causing harm to others in matters of no benefit to him [to the person causing harm], such as the one who prevents that which does not harm him while the person who is prevented from it is harmed. A group of scholars have favored this meaning among whom is Ibn ‘Abd al-Barr and Ibn as-Salaah.
It was also said: الضَّرَرُ Harm: is to harm the one who does not harm him, and الضِّرَارُ reciprocal harm: is to harm in an impermissible way the one who has harmed him.” [End of quote]
As for what the questioner mentioned that a person is required to prevent harm to himself and his family, then this is true and there is no problem with it.
Allah Knows best.