A builder caught with a knife as he walked home from a house party left it in his jeans after work in an "honest mistake", a court heard.
Carmelo Ruzzo (23) forgot to take the knife out of his back pocket when he went out for the night.
Judge Anthony Halpin struck the case out, leaving him without a criminal record after he admitted a weapons charge.
Mr Ruzzo, with an address at Fairfield Avenue, East Wall, pleaded guilty to unlawful possession of a knife.
Garda Sergeant Paul Keane told Dublin District Court the accused was stopped on Gardiner Street at 5am on March 1.
He was searched and a boxcutter knife was found in the back pocket of his jeans.
It was a variation on a Stanley knife, Sgt Keane said.
The accused had no previous convictions of any kind and was not known to gardaí, the court was told.
The DPP directed summary disposal of the case at district court level, and Judge Halpin accepted jurisdiction to deal with it.
The offence was an "honest mistake on his part", defence solicitor Anna Bridgeman said.
Mr Ruzzo, originally from Italy, was living and working in Ireland, the court heard.
On the day in question, he had finished work, left the knife in his pocket and went on a night out.
He was stopped by gardaí in the early hours of the morning, coming from a party.
"I take it this was before the lockdown," Judge Halpin said.
Ms Bridgeman said it was, and asked the judge to consider leaving the defendant without a conviction.
Taking the accused's plea of guilty and previous good record into consideration, the judge said he found the facts proved and struck the case out.