Weed and custody?

I'm posting to find out anyone else's experience with this. Basically my BF smokes weed. He has a custody and visitation hearing coming up. If his ex accuses him of smoking weed will that be the end of him being able to get visitation with his child?  He's not a bad dad and the ex lets him have his child whenever she's not mad at him but as soon as she gets mad about something, she keeps the child from him. I've never seen him smoke weed around his child but yes he's a smoker.