Sunan an-Nasa'i
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."
أَخْبَرَنَا أَحْمَدُ بْنُ سُلَيْمَانَ، قَالَ حَدَّثَنَا عَفَّانُ، قَالَ حَدَّثَنَا وُهَيْبٌ، قَالَ حَدَّثَنَا أَيُّوبُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " مَنْ حَلَفَ عَلَى يَمِينٍ فَقَالَ إِنْ شَاءَ اللَّهُ فَهُوَ بِالْخِيَارِ إِنْ شَاءَ أَمْضَى وَإِنْ شَاءَ تَرَكَ " .
Grade: sahih (Darussalam)
Reference