Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) says that the Prophet (peace and blessings be upon him) said: "Whoever swears an oath and says 'In sha' Allah', he has the choice: if he wishes he may do it, or not do it."
A weak hadith has been narrated on this from Sayyiduna Mu'adh bin Jabal (may Allah be pleased with him) as marfu' (attributed to the Prophet).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 15119