Justin Wild’s entire industry is supposed to be about compassion. But what the funeral director in Ridgewood faced when he had cancer was quite the opposite.

He had been prescribed medical marijuana for his severe pain, which he says he took only at night. But then one day he got into a car accident, which triggered an automatic drug test at work.

Marijuana is detectable in your body for up to a month after using it, so of course Wild tested positive. That doesn’t indicate that he was high. There was no allegation that he was at fault for the accident, impaired or driving erratically.

But no matter. He was fired. Have a few beers with your co-workers after hours, no big deal. But apparently, a man who uses legal pot at night isn’t even fit to work with dead people.

The effects of marijuana usually wear off after about four hours. If you take it to sleep, you’ll be fine in the morning – just like having a couple martinis. Why fire a man for one, and not the other?

Wild sued, and an appellate court agreed this could qualify as discrimination. If you fire someone simply for being a medical marijuana patient, you are firing them for having a disability. As long as patients aren’t impaired on the job, they are protected by a state law against discrimination.

Gov. Phil Murphy has since signed another law to affirm this. But it’s not retroactive, and Wild’s case is not yet over: The funeral home appealed, and our state Supreme Court just announced it will take this up.

Let’s hope the justices double down in his defense. Just like you shouldn’t get arrested for using medical marijuana, you shouldn’t have to lose your job for it – and more often than not, your health insurance too.

It’s true that we don’t yet have a sobriety test that works for marijuana, and tells you exactly when the drug was ingested, or at what point you might be impaired.

Any medication that makes you drowsy, like Xanax, might interfere with some jobs like operating heavy machinery. But whenever possible, an employer should provide a reasonable accommodation to someone with a disability.

Wild was directing a funeral home, not operating an 18-wheeler. And there was no claim that marijuana was interfering with his ability to drive a hearse.

Under the new law Murphy signed, an employer can’t fire you for using medical marijuana without first establishing a reasonable cause to do a drug test, then, that you’re actually impaired at work. It’s a sensible standard.

Punishing people for taking medical marijuana instead of a more socially accepted drug like Xanax is shunning, not science.

Bookmark NJ.com/Opinion. Follow on Twitter @NJ_Opinion and find NJ.com Opinion on Facebook.