My father dictated a letter, and I wrote it on his behalf, to Ubaydullah bin Abu Bakra, who was then the judge of Sijistan, saying, "Do not pass judgment between two parties while you are angry, for I heard the Messenger of Allah ﷺ say, 'No one should pass judgment between two parties while he is angry.'"
أخبرنا قتيبة قال حدثنا أبو عوانة عن عبد الملك بن عمير
كتب أبي وكتبت له إلى عبيد الله بن أبي بكرة وهو قاضي سجستان أن لا تحكم بين اثنين وأنت غضبان فإني سمعت رسول الله ﷺ يقول لا يحكم أحد بين اثنين وهو غضبان
Reported by Muslim, Judgments, chapter on the disapproval of a judge issuing rulings while angry, no. 1717, from Qutayba, and Bukhari, Rulings, chapter on whether a judge may issue rulings or give a legal opinion while angry, no. 7158, from the hadith of Abdul-Malik bin Umayr, with the same chain.