Jabir bin Abdullah reported,

A man stood up on the day of the Conquest of Mecca and said, "Messenger of Allah, I made a vow to Allah that if He granted you victory over Mecca, I would pray two units of prayer in Bayt al-Maqdis."The Prophet ﷺ replied, "Pray here."The man repeated his question, and the Prophet ﷺ said again, "Pray here."When the man repeated it once more, the Prophet ﷺ said, "Then do as you wish."

Azami 7138

Sahih

عن جابر بن عبد الله

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

الأعظمي 7138صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Oaths and vows
Chapter
Vows
Section
No fulfillment of a vow in disobedience
Numbering
Jami al-Kamil 7138 (2nd edition)
Azami 7138