The Messenger of Allah ﷺ said, "Whoever takes an oath and says, 'If Allah wills,' has made an exception."
أخبرنا محمد بن منصور قال حدثنا سفيان عن أيوب عن نافع
قال رسول الله ﷺ من حلف فقال إن شاء الله فقد استثنى
[Its chain of transmission is sahih] Previously mentioned, no. 3824, and it is in Kubra, no. 4770.