That the Messenger of Allah (ﷺ) said: "Whoever swears and says: 'If Allah wills (Insha Allah), then he will not have broken it."
Jami` at-Tirmidhi Book 20, Hadith 10