It was narrated from Ibn 'Umar that the Messenger of Allah said:"Whoever swears an oath and says, 'If Allah wills,' then he has the choice: If he wishes, he may go ahead, and if he wishes he may not."
أَخْبَرَنَا أَحْمَدُ بْنُ سُلَيْمَانَ، قَالَ حَدَّثَنَا عَفَّانُ، قَالَ حَدَّثَنَا وُهَيْبٌ، قَالَ حَدَّثَنَا أَيُّوبُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " مَنْ حَلَفَ عَلَى يَمِينٍ فَقَالَ إِنْ شَاءَ اللَّهُ فَهُوَ بِالْخِيَارِ إِنْ شَاءَ أَمْضَى وَإِنْ شَاءَ تَرَكَ " .
Nesai
The Book of Oaths and Vows • Hadith 3830