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