A sentencing hearing at Leeds Crown Court heard how Hazel Miller, 37, of Sutherland Terrace, Leeds, had already pleaded guilty to possessing class A drugs.
But it was argued that Miller was compelled to store the drugs in her house by unscrupulous dealers taking advantage of her "extreme vulnerability" as a single woman.
The court was told that, after a police raid on her house on April 1, 2019, officers found 146g of heroin - valued at £15,850 - divided up into wraps ready for street dealing, as well as several wraps of cannabis.
Prosecuting the case Adam Walker said while Miller was the custodian of the drugs, she was not directly involved in selling them, and was coerced into doing so by dealers - a practice known as "cuckooing".
He added: "She always said she had been compelled to store the drugs."
Mitigating for Miller, Michael Anthony Collins said: "She is a victim because she has been placed in a position of extreme vulnerability by others - she now refuses to name them for fear of reprisals.
"Her husband has been incarcerated for 42 months for burglary.
"Word got out on the street that Tom Miller is locked up and that Hazel is living alone in the house. It is in that vulnerable situation that she is used.
"She was a single woman with no one there to protect her. For those living on an estate, going to the police is a very difficult step to take."
Sentencing Miller, Recorder Gurdial Singh said: "You were a custodian acting with a degree of compulsion. You allowed, by your limited role, class A drug dealing to take place.
"Your offending is so serious given the quantity of drugs found.
"It does not have to be an immediate custodial sentence. I am persuaded you don't pose a risk to the public - punishment can be served in the community."
He gave Miller a 20 month prison sentence, suspended for two years, as well as 20 rehabilitation days, and 100 hours unpaid work.