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