A bookkeeper who was stopped by gardai in the city centre was carrying a stolen bank card.
Robert Byrne (26) told off-icers he had been "simply handed" the card by someone.
Judge Brian O'Shea told him to pay the victim €300 in compensation to avoid jail.
Byrne, of New Cabra Road, Dublin 7, admitted possession of stolen property.
Dublin District Court heard that a garda who was on patrol in Middle Abbey Street at 12.50am last July 1 saw Byrne acting suspiciously.
When stopped, he was found to be carrying an AIB bank card that was not in his name.
Byrne knew it was stolen and signed the garda's notebook to that effect, the court heard.
He was arrested and taken to Mountjoy Garda Station.
Byrne had 39 previous convictions for offences including theft, assault, sale or supply of drugs and garda obstruction.
He had a drug problem that "would appear to have resolved itself at the moment", said Niall O'Connor, defending.
He was a "very articulate and bright man" who was now stable on methadone.
Byrne had three young children and could "contribute positively" to society when not taking drugs, Mr O'Connor told the court.
On the day in question, Byrne was "simply handed this card", said Mr O'Connor.
Judge O'Shea initially said he would adjourn the case to May and would dismiss the charge under the Probation Act if Byrne paid €300 compensation to the victim.
Otherwise, he would sentence him to a month in prison.
Byrne asked for more time to pay the money.
Judge O'Shea agreed to adjourn the case to July 18.
Byrne was remanded on continuing bail.