That the Prophet (ﷺ) said: "Whoever vowed to obey Allah, then he should obey Him. And whoever vowed to disobey Allah, then he should not disobey Him."
Jami` at-Tirmidhi Book 20, Hadith 3