A Dublin Bus passenger who hit a bus driver did so in a "jokish" fashion and did not mean any harm in it, a court heard.
Glen Keegan (37) was getting off the 27C bus when he struck the bus driver in the face.
The assault left the driver with redness around the eye.
The matter was brought before Judge Patricia McNamara for sentencing after she ordered Keegan to complete the restorative justice programme.
Judge McNamara said Keegan had completed the programme and written a letter of apology to the victim.
The judge said she would impose a four-month suspended sentence if Keegan donated €100 to St Vincent de Paul.
The defendant, of Russell Lane in Tallaght, had admitted before Tallaght District Court to assaulting a Dublin Bus driver.
The assault took place on the 27C bus at Jobstown Road in Tallaght on August 20, 2017.
Sergeant Michael Ahern said Keegan was getting off the bus when he struck the injured party in the face.
The driver was left with a sore eye and redness around the area.
Defence solicitor Kevin Tunney said Keegan's behaviour wasn't very nice, but he had lifted his hand in a "jokish" manner.
He said Keegan was not aggressive towards the driver.
Judge McNamara said the assault had been an unwarranted and unprovoked attack on a person who was providing a public service.
She adjourned final sentencing to October to allow Keegan to bring a charity contribution to court.