A kitchen fitter who sold sleeping tablets to undercover gardai was on heavy pain medication at the time following a traffic accident.
Karl McGurk (31) spent a year in a wheelchair but is now off all medication and looking forward to returning to work.
Judge David McHugh imposed an 11-month sentence but suspended it for two years, saying he accepted that McGurk had "fallen on hard times".
The defendant, of Sheephill Avenue, Blanchardstown, admitted before Blanchardstown District Court to three counts of possession of sleeping tablets for sale or supply.
Sgt Maria Callaghan said McGurk sold trays of diazepam and alprazolam to undercover gardai on three separate occasions.
Sgt Callaghan said the street deals took place at Corduff Park, Blanchardstown, on May 18, 2015; four days later at Blackcourt Road, also Blanchardstown; and there again on July 14 last.
The sergeant said the street deals were each worth €25, making a total of €75.
She told the court that gardai made McGurk aware they were undercover officers, but he continued selling the tablets.
The court heard McGurk has seven previous convictions.
Defence lawyer Aoife O'Halloran said McGurk's parents died when he was four and he was raised by his aunt and uncle.
She said he previously worked in the construction industry, fitting insulation.
However, he was involved in a serious road accident that left him unable to work.
The court heard McGurk shattered his pelvis in the accident, he spent a year in a wheelchair and was prescribed pain medication.
Ms O'Halloran said McGurk is now well enough to return to work, and is in the process of setting up a new business to install kitchens, and is hopeful of employing a number of people.
At the time of the incidents for which he was before the court, Ms O'Halloran said the defendant was on prescribed painkillers.
She also said his judgment was impaired and he was abusing alcohol.
However, she said McGurk is no longer drinking and is off all pain medication.
She added that the incidences of drug dealing have had "a very sobering effect" on him.