He wrote to his son saying that the Messenger of Allah ﷺ said, "A judge must not pass judgment between two parties while he is angry."
حدثنا محمد بن كثير أخبرنا سفيان عن عبد الملك بن عمير قال
أنه كتب إلى ابنه قال قال رسول الله ﷺ لا يقضي الحكم بين اثنين وهو غضبان
Muslim narrated it in the chapters on judgments, in the chapter on the dislike of a judge issuing a ruling while angry, hadith no. 1717, from the hadith of Sufyan. Bukhari narrated it in the chapters on rulings, in the chapter, "Should a judge issue a ruling or a legal opinion while angry?", hadith no. 7158, from the hadith of Abdul-Malik bin Umayr, with the same chain.