The Prophet (peace and blessings be upon him) said:
"Whoever swears an oath and says 'In sha Allah (if Allah wills)' bears no sin for breaking the oath."
Hadith Referenceصحیح الجامع الصغیر / حرف الميم / 6212
Hadith Gradingالألبانی:صحيح
Hadith Takhrij[ت هـ] عن ابن عمر وعن أبي هريرة. المصدر نفسه.