New Jersey workers can’t be fired for failing a drug test as a result of using medical marijuana, the state’s highest court ruled on Tuesday.

In a decision that backed an appellate court’s earlier ruling, the New Jersey Supreme Court said that patients approved under the state’s medical marijuana program are indeed protected under the Law Against Discrimination.

The case centered around an employee at a funeral home who was prescribed medical cannabis after being diagnosed with cancer in 2015. According to NJ.com, the plaintiff, Justin Wild, informed his higher-ups of the prescription the following year after he was involved in a car accident, which the suit claims was not his fault.

“Wild sued, arguing that he had been discriminated against,” NJ.com reported. “A Superior Court judge initially dismissed his case, but an appellate court sided with Wild.”

Medical Cannabis and Employment

In its ruling last year, the appellate court said it “would be ironic indeed if the Compassionate Use Act,” the state law permitting medical marijuana use for qualifying patients, “limited the Law Against Discrimination to permit an employer’s termination of a cancer patient’s employment by discriminating without compassion.”

In its affirmation of the appellate court ruling, the state Supreme Court noted on Tuesday that the physician who treated Wild’s injuries from the car accident said “it was clear [plaintiff] was not under the influence of marijuana, and therefore no blood tests were required.” Nevertheless, Wild’s boss, David Feeney, said he would need to complete a drug test before returning to work.

The Supreme Court concurred with the appellate ruling that Wild “has stated a claim sufficient to survive defendants’ motion to dismiss and that there is no conflict between the Compassionate Use Act and the LAD,” and that the “Compassionate Use Act does have an impact on plaintiff’s existing employment rights.”

“In a case such as this, in which plaintiff alleges that the Compassionate Use Act authorized his use of medical marijuana outside the workplace, that Act’s provisions may be harmonized with the law governing LAD disability discrimination claims,” the court said Tuesday.

Former New Jersey Gov. Jon Corzine signed a bill legalizing medical marijuana on his final day in office in 2010. Last month, New Jersey lawmakers initiated bills aimed at establishing protections for marijuana companies in the state and individuals on workers compensation prescribed to medical cannabis.