It was narrated from 'Aishah that the Messenger of Allah said:
"Whoever vows to obey Allah, let him obey Him, and whoever vows to disobey Allah, let him not disobey Him."
أَخْبَرَنَا قُتَيْبَةُ، عَنْ مَالِكٍ، عَنْ طَلْحَةَ بْنِ عَبْدِ الْمَلِكِ، عَنِ الْقَاسِمِ، عَنْ عَائِشَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ مَنْ نَذَرَ أَنْ يُطِيعَ اللَّهَ فَلْيُطِعْهُ وَمَنْ نَذَرَ أَنْ يَعْصِيَ اللَّهَ فَلاَ يَعْصِهِ ‏"‏ ‏.‏
GradeSahih (Darussalam)
Reference : Sunan an-Nasa'i 3806
In-book reference : Book 35, Hadith 46
English translation : Vol. 4, Book 35, Hadith 3837