Security staff reacted swiftly when they realised a man was using drugs at a Mansfield nightclub, a court heard.
They detained him and called the police, who found cocaine and cannabis on the 22-year-old man.
Cory Taylor, of Cross Lane, Huthwaite, Sutton, was arrested and found to be in breach of a suspended prison-sentence imposed for other drugs offences.
Unemployed Taylor pleaded guilty at Nottingham Crown Court to two charges of possession of class A and class B drugs at the club, which was not named, in the early hours of Sunday, February 28.
Noel Philo, prosecuting, said the amounts of cocaine and cannabis were small and it was clear that they were for Taylor’s own use and not for dealing purposes. But he described the offences as “very foolish”.
The court heard that Taylor was barely one-quarter of the way through the two-year suspension of his 12-month jail sentence, which had been imposed in June 2015 for the supply of cannabis and the possession of cannabis with intent to supply.
However, his barrister, Sarah Munto, mitigating, argued that it would be unjust to activate that order now. This was because he had made concerted efforts to rid himself of his drugs problem.
“This has been a wake-up call,” said Miss Munro. “He realises how close he is to losing his liberty and it has scared him.
“He had a habit, an addiction, that he was unable to end immediately. But he has now tackled his drugs use. He has returned negative tests for cocaine over several weeks and he has recently managed to stop his cannabis use as well.
“Cannabis had been instilled into his lifestyle for some time, but he is now free of both drugs.
“He is also working hard with the probation service and carrying out training with them because he wants to better himself and further his career as a joiner.”
The judge, Recorder Roger Evans, told Taylor: “Ordinarily, the suspended sentence would be implemented. But all the efforts you have been making are positive signs.”
He spared Taylor prison, ordering him instead to carry out 40 hours of unpaid work in the community and extending the period in which he must be supervised by probation officers by 18 months.
For the new drugs offences, he was given a community order for 12 months and placed on a curfew for two months between 9 pm and 5 am.
The judge warned him: “If you come back before the courts again, your luck will run out.”