Stephen Doyle (35) had survived being hit by a car and attacked by two men and he was very paranoid and anxious about his safety, his lawyer said.
Judge Gerard Jones ordered Doyle to enter into a peace bond for 12 months.
The defendant, of Méile an Rí Road, Balgaddy, Lucan, admitted possession of a knife at Foxdene Avenue in Clondalkin on August 1, 2020.
Garda Niamh Conway told Blanchardstown District Court gardaí got a smell of cannabis and they decided to search Doyle under the Misuse of Drugs Act.
During the course of the search, a kitchen knife was found hidden in the lining of his jacket, she said.
Doyle was taken to Ronanstown garda station, where he was later charged and released on bail. The court heard Doyle had 50 previous convictions.
Defence solicitor Danielle O’Sullivan said that Doyle was carrying the knife for his own safety.
Ms O’Sullivan said Doyle had been homeless and was suffering from addiction at the time of this offence.
He was concerned that there was a threat on his life. He had valid reasons for this, as, the tendons in his hands had been damaged in an incident in 2019. Doyle had also been attacked by two men and hit by a car, in an incident which he reported to gardaí.
Ms O’Sullivan said Doyle was “very paranoid and anxious” at the time of this incident, and he felt the threat was real and there was an imminent threat to his life.
As a result, Doyle started carrying the knife around with him, as it helped him feel safer.
The knife was hidden on his person, and had not been produced at any stage, the court heard. Ms O’Sullivan asked the judge to be as lenient as possible, saying Doyle, who was unemployed, had a partner and two children.
He was attending a drugs counsellor, had reduced his methadone dosage from 80mgs to 40mgs, and was providing clean urine samples.
Ms O’Sullivan said Doyle was doing very well at the moment, was looking for work and he was hoping to get on to a list for a community employment scheme.