A father-of-one's motive for stealing clothes from a Dublin store was a "mystery", a judge said.
John Gali (44) admitted taking €144 worth of goods from Penneys in a "moment of madness".
Judge David McHugh said the "mind boggles" as to why Gali did it, but he would strike the case out, leaving him without a conviction, if he made a €300 charity donation.
Gali, of Collegewood Manor, Clane, Co Kildare, pleaded guilty to theft.
Blanchardstown District Court heard the accused went to Penneys, Liffey Valley Shopping Centre, on February 21.
He placed a number of items worth a combined €114 into his bag and walked out of the shop without paying.
Gali had no previous convictions.
The accused had been in Ireland for 18 years and had held the same stable job in manufacturing for most of that time, the court heard.
Judge McHugh asked defence solicitor Simon Fleming what Gali's difficulty was on the day of the theft.
"It was just a moment of madness, he shouldn't have done it," Mr Fleming said.
He said Gali had learned his lesson and was very embarr- assed to be in court.