Nafi' narrates from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "When a man swears an oath and says 'In sha' Allah' (If Allah wills), then he has made an exception."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 15118