A man caught with pepper spray on a keyring had bought it in a gift shop while on holiday in Turkey, where it was "freely available", a court was told.
In a separate incident, Keith Reddy (21) was found in a stolen car that he had "recklessly" bought for €300.
Judge Paula Murphy spared him jail and put him on 12 months' probationary supervision.
Reddy, of Moatview Court, Priorswood, pleaded guilty to unlawful possession of the pepper spray at Carton Terrace, Poppintree.
Dublin District Court heard gardai found him with the canister at 5.35pm on September 11, 2018.
Reddy also separately admitted possession of a stolen car at the Summit car park, Howth, on June 13, 2017.
Gardai stopped the 06-registered car and became aware of a strong smell of cannabis.
Reddy, who was in the passenger seat, was searched and found in possession of the keys, a garda said.
It was discovered that the car was stolen.
A garda estimated the value of the vehicle at €7,000 to €8,000.
Reddy had bought it for €300 through "recklessness" rather than "the full knowledge that the car was stolen", his solicitor Lorraine Stephens said.
He was fully co-operative in the search in which the pepper spray was found.
"It's freely available in gift shops in Spain or Turkey," Ms Stephens said, adding that the accused had "put all matters behind him in relation to substance abuse".
Reddy had good family support when he was clean, but that was previously withdrawn.
He was living back in the family home, "hopeful for the future" and aiming for a qualif- ication in the fitness industry.