Abū Bakr al-Rāzī al-Jaṣṣāṣ (d. 370H) (رحمه الله) said in Aḥkām al-Qurʾān, after quoting various ḥadīths pertaining to the plague:[1]
So in these reports is the prohibition of leaving the land of the plague [when intending to] flee from it and the prohibition of coming to [the land of plague] as well.
Now if a person says: “If the lifespans have already been decreed and confined, never being hastened or delayed from their times, then what is the angle of the prohibition of the Prophet (صلى الله عليه وسلم) from entering a land of plague alongside his prohibition from leaving [the land] on account of it, yet there is no difference between entering it and remaining in it”. It is said to him: The angle which the Prophet [came from] is that if a person enters it while there is the plague therein, it is possible that death and the appointed time [that were already decreed for him] would come to him in that land. So a person may say: “If he had not entered that land, he would not have died.” So he prohibited from entering [that land] so that this would not be said...
And upon this [same] meaning which we have presented is what is related from the Prophet (صلى الله عليه وسلم): “Let not the owner of sick camels pass them by the healthy camels of another”, alongside his saying: “There is no contagion, and no omen [in the overhead flight of birds]”—so that when a healthy camel is afflicted with an illness after a sick camel passed by it, a person does not say: “The [sick] camel passed the illness to it.” And it was said to Allāh’s Messenger: “There is a perforation on the lip of a camel [due to mange], and then all the camels get mange.” So the Prophet (صلى الله عليه وسلم) said: “So what gave it to the first one?”
Download the full article below: