A judge has criticised guidelines preventing heroin addicts from getting methadone when they are homeless as a “charter to commit crime”.

Adam Goral, 21, of Clements Road, East Ham, was handed a community order for flouting an anti-social behaviour order banning him from travelling on buses and targeting commuters for their possessions.

But the pickpocket could not prove he had an address and failed to carry out 80 hours of community work after he was refused his heroin substitute, Inner London Crown Court heard.

Judge Ian Darling said: “It seems to me a strange state of affairs when a vulnerable person who can’t prove his address can’t get his methadone. It’s almost a charter to commit crime.”

The judge jailed Goral for nine weeks but he is due to be released within days due to time served on remand.

William Chipperfield, prosecuting, said Goral was given the Asbo by Stratford magistrates in October 2010 “due to his offending history”. He was “prohibited from boarding or attempting to board London buses or loitering at bus stops”.

The order, which centred around the Canning Town area, also banned him from being in the company of two named accomplices.

But on May 26 last year a police community support officer saw him on a No.25 bus and he was arrested.

He was given a community order for the breach but he did not turn up for work because he continued taking heroin.

Judge Darling said: “Your life appears to be going badly wrong at the moment.

“You have had some time in custody and I hope it has given you the opportunity to reassess the direction you are going in.

“You fall to be sentenced for the breach of the community order that was imposed on you. You didn’t turn up and it took over two months to locate you.”

Speaking from the dock, Goral tried to reassure the judge about being allowed his freedom.

He said: “I have got my medical card. I can get my methadone, no problem.”

Goral admitted breaching a court order.