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." (DE)
Reference (DE): Bulugh al-Maram 1387 (DE)
In-book reference (DE): Book 13, Hadith 14 (DE)
English translation (DE): Book 13, Hadith 1387 (DE)