My father dictated (and I wrote for him) to Ubaidullah b. Abu Bakra while he was the judge of Sijistan: Do not judge between two persons when you are angry, for I have heard Messenger of Allah ﷺ as saying: None of you should judge between two persons when he is angry.
أَنْ لاَ تَحْكُمَ بَيْنَ اثْنَيْنِ وَأَنْتَ غَضْبَانُ فَإِنِّي سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ لاَ يَحْكُمْ أَحَدٌ بَيْنَ اثْنَيْنِ وَهُوَ غَضْبَانُ