Sayyiduna Abdullah bin Amr (may Allah be pleased with him) narrated: The Prophet (peace and blessings be upon him) said: "Whoever swears an oath and then sees something better than it, let him give expiation for his oath and do what is better."
Imam al-Tabarani recorded it in al-Mu'jam al-Kabir; its chain contains a narrator, Muslim bin Khalid al-Zanji, whom Ibn Hibban and others declared thiqah (trustworthy), while Imam Ahmad and others declared him da'if (weak).