On Tuesday, The New York Court of Appeals overturned a subpoena that’s been hanging over investigative reporter Jana Winter’s head since March, and resolved a legal battle that lasted over a year. The subpoena had called on Winter to appear in the James Holmes criminal trial in Colorado, where she would have been compelled to testify as to the identities of her two anonymous sources for a story she filed about Holmes last July. While the court’s ruling has freed her from the threat of jail time, the subpoena itself did quite a lot of damage in the meantime.

In ordering the subpoena, Holmes’ defense attorneys wanted to find out which “law enforcement sources” violated a gag order by leaking to her that Holmes had sent a notebook with violent drawings to a psychiatrist prior to the shooting in Aurora. (The defense is arguing that Holmes is not guilty by reason of insanity.) Winter refused.

In the absence of a federal shield law—for the time being, at least—each state varies in how much protection it will grant to reporters in cases like this one. New York’s shield law gives absolute protection: No court in the state can hold a reporter in contempt for refusing to disclose confidential information or sources. Colorado also has a shield law, but it is more qualified. Judges in Colorado weigh a reporter’s First Amendment interests with someone’s need for the information in the context of a case.

Winter, a Fox News reporter who lives and works in New York, argued that she should be able to claim New York shield law protection, even though the court proceedings were in Colorado. After much legal back-and-forth, this question made its way through the New York court system all the way up to the state’s highest, the New York Court of Appeals.

During oral arguments to the Court of Appeals last month (transcript available here), one of Winter’s attorneys, Christopher Handman, argued that compelling her to testify would harm her career. Judge Robert Smith asked if this was being “overblown,” since other states have less protective shield laws than New York, and people still seem to be able to make a living as investigative reporters in those states.

“Do you have an example of any journalist anywhere whose career was ever ended because he or she burned a source?” Smith asked. “Well, no, because most journalists don’t burn their sources,” Handman replied.

The win for Winter on Tuesday came by a slim margin, three to twofour to three. “[T]here is no principle more fundamental or well-established than the right of a reporter to refuse to divulge a confidential source,” wrote Judge Victoria Graffeo in the majority opinion. Requiring Winter to appear in Colorado and testify about those sources, she went on, “would offend the core protection of the Shield Law, a New York public policy of the highest order…. We therefore conclude that the subpoena application should have been denied.” Judge Smith wrote the dissenting opinion, in which he argued that the jurisdiction of a New York law should not apply because the “allegedly privileged communications took place wholly in Colorado.”

Tuesday’s ruling is surely a huge weight off her shoulders, but the legal process itself has caused her professional setbacks. She was put in an impossible bind, threatened with jail time for doing a fundamental part of the job of journalism—protecting her sources’ identities—while that threat prevented her from continuing to report other stories. Current and future sources didn’t trust her more for her pledge to keep her previous ones anonymous, unfortunately. They avoided her altogether.

In an affidavit she filed in July in the Colorado court (recently obtained from her lawyers), Winter described the “severe hardship” that the subpoena had caused in both her “personal and professional lives” in previous months. Several tips and leads she had on various aspects of the Holmes case had since dried up because her sources were spooked by her subpoena. She also described, in vague terms, a report about a “high-profile national security investigation” that she had been pursuing up until she was served with the subpoena. “After news of my subpoena broke, several sources around the world who had indicated they would provide me with additional information about this case were chilled and refused to speak to me, citing the news of my subpoena,” Winter wrote. “As a result, this important news has not come to light either by my reporting or anyone else’s.”

Lauren Kirchner is a freelance writer covering digital security for CJR. Find her on Twitter at @lkirchner