It is narrated marfu‘ from Sayyiduna Ibn ‘Umar (may Allah be pleased with them both) that whoever says "In sha Allah" while taking an oath, he has a choice: if he wishes to fulfill his oath, he may do so, and if he wishes to retract from it, he may do so without being sinful.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 5362