A DISC jockey faced the music after being stopped in a car with cocaine in his wife's purse and his three-year-old grand daughter in the back seat.
Colin Barker, 54, was told by judge Sara Dodds: "It does not take much imagination to see that could result in a tragic accident."
Barker, formerly of Selby but now of Alexandra Street, Goole, was given a 12-month community order including a requirement to carry out 200 hours of unpaid work.
He was also ordered to pay a £60 statutory surcharge and placed under a three month curfew which will prevent him working as a weekend DJ.
He admitted possession and being concerned in the supply of amphetamines.
York Crown Court heard no amphetamines were found in the car when he was spotted by police while driving suspiciously on the A645 between Rawcliffe and Drax on May 3 last year.
But he pleaded guilty after the officers found cocaine in his wife Michelle's purse and mobile phone texts referring to "powder" and payment.
Police also found £5,000 in cash in a metal box under Mrs Barker's seat, it was said.
Helen Wheatley, prosecuting, said this was money Barker had earned from working as a DJ and buying and selling records on E-bay - which he had failed to declare to the taxman. He had already signed the cash over to the Crown.
Defending barrister Mark Partridge said his client was a recreational drug user whose habit was "intrinsically linked with the Northern Soul culture".
The judge was concerned that the car contained both plastic bags to put sweets in for children and 544 milligrammes of cocaine.
Underlining the risk of "cross contamination," she added: "No amphetamines were found when you were stopped in the car with your three-year-old grandchild - but other drugs were recovered. At 54 you really should know better."
Mrs Barker, 52, of the same address, was cleared of all related counts after the prosecution offered no evidence.