Abu Hashim Jafari was one of the prominent students and companions of Imam Ali al-Reza, Imam Muhammad al-Jawad, and Imam Ali al-Hadi (peace be upon them).
One day, Imam Ali al-Hadi (peace be upon him) saw him and firmly said: “Why do I see you sitting with Abdulrahman ibn Yaqoub?”
Abu Hashim replied: “Abdulrahman is my uncle.” Imam (peace be upon him) said: “Abdulrahman speaks incorrectly about God. He describes the pure essence of God as a body and attributes bodily characteristics to Him. Either sit with him and abandon us, or sit with us and leave him!”
Abu Hashim responded: “Let him say whatever he wants. What harm would it do to me if I do not agree with his words?”
Imam (peace be upon him) said: “Do you not fear that a punishment might come upon him and that punishment will also reach you? Have you not heard the story of the man who was a follower of Moses (peace be upon him), and whose father was one of Pharaoh’s companions? When Pharaoh’s army reached the sea while pursuing Moses (peace be upon him), that man separated from Moses’ army and went to his father to try to guide him away from Pharaoh’s followers and bring him to Moses (peace be upon him). As they were discussing at the shore, the punishment of God descended and Pharaoh’s army was drowned. The father and son, who were near Pharaoh’s army, were also drowned.
The news reached Moses (peace be upon him) and the question arose: ‘The father deserved punishment, but why was the son drowned?’ Moses (peace be upon him) replied: ‘The son is in God’s mercy, but when punishment descends, no one can defend the one close to the wrongdoer.'”
In truth, Imam Ali al-Hadi (peace be upon him) teaches us that one should never feel immune from the negative consequences of associating with the misguided and sinful people. Therefore, except in situations of necessity or in fulfilling divine duties, one should avoid keeping company with the misguided and sinful, for such companionship is so risky that it might lead to a person being caught in the flames of corruption in belief or morals, and the darkness and fire of their misguidance could affect him as well.[1][2]
(Adapted from the book A Look at the Life of Imam Ali al-Hadi (peace be upon him) by Muhammad Muhammadi Eshtihardi)
Footnotes:
[1] It should be noted that if one’s divine duty requires interacting with such individuals for purposes like guidance, family relations, or other legitimate reasons, one should do so only when necessary and in a way that fulfills their responsibility. In this case, even if the negative consequences of such interaction, like the situation the Imam (peace be upon him) mentioned, affect a person, he will still be covered by God’s mercy.
[2] Al-Kafi, Volume 2, Book of Faith and Disbelief, Chapter on Sitting with the People of Sin, pages 374-375.