A homeless man who chose "the lesser of two evils" by acting as gardener in a cannabis grow house instead of sleeping on the streets has been jailed for 10 years.
Defence counsel Michael Bowman SC said Alan Lynch (58) found himself sleeping rough after being released from prison following a sentence for possessing drugs.
Mr Bowman said his client became drug and alcohol-dependent while sleeping on the streets, but got involved with the grow house when he started to physically deteriorate outside.
He submitted to Judge Melanie Greally that the father-of-five had realised he wouldn't have lasted much longer living rough and chose "the lesser of two evils" by reoffending.
Lynch, of no fixed abode, pleaded guilty at Dublin Circuit Criminal Court to cultivating cannabis worth a potential €763,560 at Heronford Lane, Shankill, Dublin, in June 2016.
He has 19 previous convictions for road traffic offences and one of drugs possession, for which he received a four-year sentence in 2012.
Garda Des Molloy said he and colleagues began investigating the Heronford Lane address after a blue Mercedes van crashed into a wall nearby.
Witnesses told gardai that the van had been at the address frequently and that Lynch, who was seen in the vehicle, also lived in the area.
Gda Molloy said officers went to the address and picked up a strong smell of cannabis from a vent at the rear of the property.
They set up surveillance and got a warrant to search the Mercedes.
During the investigation, gardai found cannabis plants at various stages of growth in the house's basement.
Analysis later revealed that of the 917 plants seized, 501 were ready for harvest.
Gda Molloy said the 1.5kg of cannabis also found during the raid was worth €29,960.
He said a co-accused who also acted as a gardener received a four-and-a-half-year sentence with the final two suspended.
Gda Molloy said Lynch had signed a lease using his own name and driving licence to rent the house from the owner.