That the Messenger of Allah (ﷺ) said: "Whoever swears about an oath and says: 'If Allah wills (Insha Allah), then there is no breaking of the oath against him."
Jami` at-Tirmidhi Book 20, Hadith 9