A man who had a knife in his pocket has been jailed for six months by Nottingham magistrates.
It was found when police officers searched Nathan Smith for drugs, the court was told.
He had none but the weapon was found instead.
Smith, 33, of London Road, Nottingham pleaded guilty to having a locking knife on Malin Hill on February 4.
He had a similar previous conviction which put him at risk of the six-month term, which the magistrates ordered.
Miss Suzanne Jovanovic, who represented Smith, said that he had managed to get off drugs and find settled accommodation.
He was given the knife because he was worried for his safety. At the time, he was living on the streets of the city. She said that the knife was in a pocket and added: “He was not brandishing it.”
Joanne Gough, prosecuting, said that police stopped Smith to see if he had any drugs. He did not but they found the knife during the search.