Abdullah bin Umar reported,

Ali used to disapprove of making conditional intent during Hajj and would say, "Is the practice of your Prophet ﷺ not sufficient for you? He did not stipulate any condition. If something prevents one of you from completing it, let him come to the House, perform tawaf around it, walk between Safa and Marwa, then shave or shorten his hair and exit the state of ihram. He must then perform Hajj the following year."

Nasai 2771

Sahih

أخبرنا إسحق بن إبراهيم قال أنبأنا عبد الرزاق قال أنبأنا معمر عن الزهري

عن سالم عن أبيه

أنه كان ينكر الاشتراط في الحج ويقول ما حسبكم سنة نبيكم ﷺ إنه لم يشترط فإن حبس أحدكم حابس فليأت البيت فليطف به وبين الصفا والمروة ثم ليحلق أو يقصر ثم ليحلل وعليه الحج من قابل

النسائي 2771صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Rituals of Hajj
Chapter
What one who is prevented from Hajj should do if he did not stipulate a condition
Numbering
Darussalam 2771
Nasai 2771