The Messenger of Allah ﷺ said, "There is no vow and no oath in what you do not own, nor in disobedience, nor in severing ties of kinship."
أخبرنا إبراهيم بن محمد قال حدثنا يحيى عن عبيد الله بن الأخنس قال أخبرني
قال رسول الله ﷺ لا نذر ولا يمين فيما لا تملك ولا في معصية ولا قطيعة رحم
[Its isnad is hasan] Abu Dawud reported it in "The Book of Oaths," chapter "The oath concerning severing ties of kinship," Hadith 3274, from the hadith of Ubaydullah bin Akhnas, through this route, and it is also found in al-Kubra, Hadith 4734.