When Penelope Alvarez caught her teenage son, Alex, vaping marijuana, her distress wasn’t just about the pot — not in California, and not when her own mother was off getting legally stoned at the opera.

“The reality is, if a white kid like Dylan gets caught with a little weed, he gets a cool story,” she told her son, referring to his friend. She and Alex, characters played by Justina Machado and Marcel Ruiz on the sitcom “One Day at a Time,” are Cuban-American.

“You?” she went on. “You could wind up in prison.”

For the writers of “Nip It in the Bud” — Episode 5 in that show’s third season, which hit Netflix this month — the juvenile drug plot was at once a reliable sitcom standby and an opportunity to broaden the kinds of teary-eyed conversations it usually depends on. Gloria Calderón Kellett, the series’s showrunner, said she had been keen to complicate the picture, beyond “Just Say No.”

“One of the things we were talking about was vaping and, in California especially, with pot being legal now, how it’s confusing for some teenagers,” she said.