For Brown, 21, of Barkerland Avenue, Dumfries was taken to hospital with a serious eye injury and police probing what was thought to be an industrial accident came across several bags of cannabis and nine plants worth a total value of £8200.
In court on Monday Brown admitted producing cannabis at his home in January.
The court was told that Brown had been taken to hospital and police in their enquiries had come across a black bin bag containing herbal cannabis in the kitchen and a further search with a warrant turned up other bags and the nine plants in the loft.
A solicitor said that Brown, who was still receiving treatment for the eye injury, had the cannabis for his personal use.
Sheriff George Jamieson imposed a community payback order of 100 hours unpaid work.