A young man arrested for drunkenly trying to open a stranger's parked car in the early hours of the morning "simply did not know where he was", a court has heard.
Daniel Collins (22) did not own a car and did not know anyone with a car like the one he was caught trying to get into.
Judge Brian O'Shea said he would leave him without a conviction if he made a €150 charity donation.
Father-of-one Collins, of Kilworth Road, Drimnagh, pleaded guilty to public drunkenness and interfering with a vehicle.
Dublin District Court heard that the incident happened in Heytesbury, Dublin 8, on April 20 last year.
It was 3am and the accused was intoxicated and trying to open the door of a parked car.
Separately, he admitted having cannabis when he was stopped by gardai in Bunting Road, Walkinstown, on March 12 last year. He had no previous convictions.
Collins had been simply pulling at the door and there was "nothing more sinister than that" in it, his solicitor Stephen O'Mahony said.
He said his client was "extremely intoxicated" at the time.
Collins was working in the pub industry when the incident happened and got into "after-hours drinking", the court heard.
He had been drinking to excess at night and sleeping it off the following morning.
He was now working in a supermarket with early starts and that did not lend itself to the lifestyle he had in the past, Mr O'Mahony said.
Collins had now stopped smoking cannabis and curtailed his drinking.
Judge O'Shea adjourned the case and said he would apply the Probation Act if Coll- ins made a €150 donation to charity.