It is narrated from Sayyiduna Zayd bin Arqam (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "Allah, the Mighty and Majestic, is with the judge as long as he does not deliberately commit injustice; Allah keeps guiding him towards good as long as he does not want something other than it."
Hadith Referenceالمعجم الكبير للطبراني / باب الزاي / 5058