A man found a drug addict sleeping inside his car when he went to collect it from a Dundee car park.
The alarmed owner then phoned police, who woke up John McCabe, Dundee Sheriff Court heard.
McCabe, of St Mary Street, told officers he had been on his way home but had “become tired and needed a sleep”.
Afterwards he got out of the car and took a backpack which belonged to the car owner, claiming that it was his own.
Fiscal depute Trina Sinclair said: “The owner of the vehicle parked his car in Milnbank Road at 10.45pm on April 17.
“He didn’t lock it as the vehicle has a faulty locking system.
“At 11.50pm he returned to his vehicle and saw the accused sitting slumped over in the passenger seat sleeping.
“The complainer phoned police and when they arrived the accused was still inside the vehicle, sleeping.
“Police officers woke him up and he appeared confused. They asked him what he was doing.He replied that he was on his way home and had become tired and needed a sleep.”
The officers told 42-year-old McCabe to get out of the car. As he did so he picked up a rucksack.
The fiscal continued: “He told police it was his rucksack, but the complainer was standing nearby and said it was his. The rucksack was passed back to the complainer.”
Solicitor Amy Fox, defending, told the court McCabe had a long-standing drug problem and was on a methadone prescription.
She said: “On top of that he had been drinking that night.
“He was on his way home and it started to rain so he went into the vehicle to get shelter from the rain.
“He accepts he should not have done that, and he accepts he picked up the rucksack as he was exiting the vehicle.”
McCabe admitted that on April 17, at Milnbank Road, he stole a backpack and contents, while on bail.
Sheriff Carmichael ordered McCabe to complete 60 hours of unpaid work.