al-Bukhari has reported from the Hadith of 'Aishah (RA):
(Allah's Messenger (ﷺ) said) "If anyone vows to disobey Allah, then he must not disobey Him." (AR)
Reference (AR): Bulugh al-Maram 1387 (AR)
In-book reference (AR): Book 13, Hadith 14 (AR)
English translation (AR): Book 13, Hadith 1387 (AR)