A heroin addict was caught dealing the drug when another user called emergency services to complain about feeling ill because of a rogue batch, York Crown Court heard.

Police called at Stephen Jarman’s home in Cromer Street because of “concern for the health of people who had taken bad drugs,” said Prosecutor Katherine Robinson.

The court heard Jarman, 53, was found in the ground floor bedroom sorting a quantity of heroin into street deals.

Around £230 cash was also found on the property. Jarman confessed to working with others higher up the dealing chain, it was said.

Text messages found on his mobile phone showing Jarman had been selling drugs but the amounts he made were modest and he had a drugs habit of his own, Ms Robinson added.

Jarman admitted possessing a class A drug with intent to supply and was given a two-year jail sentence suspended for two years.

He was also ordered to take part in a drug rehabilitation programme and carry out 150 hours unpaid work and pay a £100 victim surcharge.

Neal Kutte, defending, said: “It’s a strange case. Originally, the police were called there because someone had told the emergency services they had had an adverse reaction to taking substances.

“The defendant is a heroin addict who had got himself involved in dealing to fund his addiction. He was making wraps of heroin. He was to take 10 and return 40.”

The 40 wraps were to go to an individual higher up the chain. He said Jarman had got into debt and was working it off by doing this, as well as feeding his own addiction.

“Heroin he had been taking was adulterated,” Mr Kutte said, adding there were rumours flying around that it had been mixed with another illegal substance.

The court heard Jarman had a long record of 32 convictions involving 70 offences – but had stayed out of trouble for nine years.