A shoplifter expecting to be jailed had a blade in a holdall he took with him to a police station.
His lawyer claimed Michael Griffin forgot to remove the item before packing the bag.
Griffin, of Donald Terrace, Hamilton, was jailed for 18 months at the town's sheriff court on Friday.