Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) said that the Prophet (peace and blessings be upon him) said: "Whoever swears an oath and right after it says 'In sha' Allah' (if Allah wills), and then breaks the oath he swore, then 'In sha' Allah' is the expiation of his oath."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأيمان / 19925