The Messenger of Allah ﷺ said, "Whoever takes an oath and adds the exception 'if Allah wills' may go back on it if he wishes or leave it, without being guilty of breaking his oath."
حدثنا محمد بن زياد حدثنا عبد الوارث بن سعيد عن أيوب عن نافع
قال رسول الله ﷺ من حلف واستثنى إن شاء رجع وإن شاء ترك غير حانث
[Its isnad is sahih] Abu Dawud narrated it in Book of Oaths and Vows, Chapter on Making an Exception in an Oath, no. 3262, from the hadith of Abdul-Warith, from him.Ayub is trustworthy and reliable, and Kathir bin Farqad corroborated him, as reported by Nasai and others. Hakim graded it sahih (4/303), as did Dhahabi.