World champion pole vaulter Shawnacy Barber nearly missed his Olympic Games debut at Rio 2016 following a tryst with a woman he met online.
The 22-year-old Canadian shot to prominence at the Commonwealth Games in 2014 when he claimed bronze, before upgrading to gold at the Pan American Games and World Championships a year later.
Barber went into the Games in Brazil as a strong candidate for a medal having jumped six metres earlier in the year, but he was very nearly not in attendance.
Over a month before Rio 2016 Barber was in Edmonton preparing for the Canadian Championships and a chance to secure his Olympic place.
In an attempt to "relieve stress" before the competition Barber posted to an online service looking for a "casual encounter" with a woman who was "drug-free and disease-free".
Barber's subsequent sexual encounter in an Edmonton hotel room almost ended his Olympic dream after kissing the woman who had answered his post through her then boyfriend.
Prior to their meeting the woman had snorted half a gram of cocaine, and Barber had unknowingly ingested the drug during their 30-minute rendezvous.
"He began kissing her and did not notice any unusual taste. His evidence was that he didn't realise there was any potential to ingest drugs by kissing (the woman)," the Sport Dispute Resolution Centre of Canada decision read.
In the woman's testimony she confirmed "there was no one else taking drugs in the hotel room" and that she "felt horrible about what happened".
The following day Barber set a Championships record to make the Canada team, however a drug test showed the presence of cocaine - which could have led to a four-year ban.
Barber described the results as a "complete shock" and at the subsequent doping tribunal with the Canadian Centre for Ethics in Sport contested the findings, explaining how the drug got into his system.
He was cleared to compete in Rio two days before the Games, with the details of the case made public on Thursday.
The ruling read: "Shawnacy Barber's choices and conduct on the night of July 8, 2016 may be viewed as risky, careless and foolish in many different ways. But the issue is, were they risky in the sense of exposing him to the possibility of ingesting a prohibited substance?
"The panel conclude that the athlete has satisfied the burden of establishing, on a balance of probability, that he bears no fault or negiligence in committing a violation in his sample.
"The athlete's period of ineligibility is hereby eliminated. This makes him eligible to compete at the Olympic Games in Rio de Janeiro."
Barber went on to qualify for the Olympic final, but he finished out of the medals in 10th place.