A judge should not judge between two persons while he is in an angry mood
Narrated `Abdur Rahman ibn Abi Bakra:
Abu Bakra, may Allah be pleased with them, wrote to his son who was in Sijistan: 'Do not judge between two persons when you are angry, for I heard the Prophet (may the peace and blessings of Allah be upon him) saying, "A judge should not judge between two persons while he is in an angry mood."
Anger is one of the situations in which one loses a large part of his mind and consciousness because it hinders him from thinking about what is going on. He does not judge properly as expected of him. In this case he is not fit to judge. Therefore, he may not judge until he is completely free of anger and restores his forbearance.
The extreme anger overwhelms the human mind, to the extent that the wise man behaves just like the mad so that his words and deeds do not count. However, he is responsible for destroying the property of the people, and then the sayings and actions are attributed to anger and not attributed to him.
If the judge is angry, his judgment is not valid, and he should have a second look at the case again if he is appointed by the leader of the Muslims.
But if the adversaries have asked him to rule among them, but he judged while he was angry, then they shall not accept his judgment, and they shall search for another judge.
The same ruling applies for: the hungry, the thirsty, the one who struggles to keep the urine, the gas or the feces.
It is also applied to the poor one who is concerned with feeding his children.
It is good for you, Muslim, not to judge between two unless you found no alternative.