It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them) that Sayyidah Dubaa’ah bint Az-Zubair bin Abdul Muttalib (may Allah be pleased with them) came to the Messenger of Allah (peace and blessings be upon him) and said: O Messenger of Allah! I intend to perform Hajj, so how should I make the intention? He said: “Say like this: «لَبَّيْكَاَللّٰهُمَّلَبَّيْكَوَمَحِلِّىْحَيْثُتَحْبِسُنِيْ.» that is, Here I am, O Allah, here I am, and my place of removing Ihram is wherever You restrain me. In this way, the condition you have stipulated is upon your Lord.”
Hadith Referenceسنن دارمي / من كتاب المناسك / 1849
To make a condition at the time of entering into ihram (state of consecration for Hajj or Umrah) such that, “If I am not able to reach Makkah, then wherever I am able to reach, there I will come out of ihram,”—the benefit of this condition is that it will be permissible for him to come out of ihram wherever he is compelled due to illness and is unable to proceed further, and he will not have to wait for the sacrificial animal (hady) to be slaughtered in Mina, as is required in other cases of being prevented (ihsar).
(Wahidi)
Imam Tirmidhi rahimahullah has said that some scholars have acted upon this, that it is permissible to make such a condition in Hajj, and then if a pilgrim becomes ill or is excused (due to some valid excuse), he may come out of ihram. And according to some scholars, whether one makes a condition or not, it is not permissible to annul the ihram. However, the first opinion is correct, which is the position of Imam Shafi’i, Imam Ahmad, and Imam Ishaq rahimahumullah.