A crowd of protesters gathered outside Ontario’s top court in Toronto on Monday as a hearing inside unfolded over whether a VICE News reporter should have to hand over communications he had with a source to the Royal Canadian Mounted Police — or possibly face jail time.

Last March, an Ontario court upheld a 2015 production order compelling Ben Makuch, who reports on issues of national security, and VICE Media to hand over all Kik instant messenger chats, or screen grabs of the chat logs, as well as any other relevant communications between him and Farah Shirdon, a young Calgary man suspected of leaving Canada to fight with Islamic State militants in Syria and Iraq.

Now the fight has reached the Court of Appeal, which will decide if it agrees with a previous decision that press freedom and civil liberties groups have slammed as a violation of journalistic integrity — and warned could have a chilling effect for reporters who are using controversial or anonymous sources.

“We’re facing not a brave new world, but a frightening new world,” Tom Henheffer, executive director of the Canadian Journalists for Free Expression, told the crowd, which waved “Stand with Ben Makuch” signs. He warned of “unprecedented times” in which journalistic integrity was being eroded around the world: from Turkey, to the United States under President Donald Trump, and also in Canada.

“Hands off sources, you don’t need ’em!” the crowd chanted. “Stand up, fight for press freedom.”

Inside the courtroom, VICE Canada lawyer Iain MacKinnon argued that the lower court judge erred in its judgment by ignoring the wealth of evidence that the RCMP has already gathered from Shirdon’s public social media presence in order to lay a number of terror-related criminal charges against him in abstentia. MacKinnon also argued that the lower court failed to balance the interests of press freedom and law enforcement powers.

And since Shirdon’s whereabouts have been unknown for years, it’s even more unlikely Makuch’s communications would be of any value, MacKinnon argued.

“There’s no practical purpose,” MacKinnon told the court. “Why go through the effort and why would it be appropriate to seize these materials from a journalist when [Shirdon] is not in custody and he’s not facing trial?”

MacKinnon quoted Makuch’s affidavit in which he said that openness and trust between journalists and sources, both confidential and non-confidential, relies on the assumption that the journalist is not an arm of law enforcement agencies. Sources would be much less inclined to answer questions if they worried that anything they said could be handed over to the police.

“There’s no practical purpose.”

However Justice David Doherty, one of three judges presiding over the hearing, took issue with that and interrupted MacKinnon to say that the fact that there’s an order compelling Makuch to surrender his communications proves that he is “the opposite of being an agent of the court.”

A coalition of media groups and civil liberties organization such as the Canadian Civil LIberties Association also made submissions in support of Makuch and VICE Canada’s case, arguing that whenever there’s a production order targeting a journalist, it creates a chilling effect on members of the media, regardless of whether or not the source in question is identified.

The government argues that Makuch’s notes and communications are vital in its case against Shirdon, even though the police force already had enough evidence to lay six terror-related charges against him.

Crown attorney Brian Puddington said he disagreed with MacKinnon that the police force has all the evidence it needs to pursue its case against Shirdon.

“It is an impossible prediction to make,” said Puddington, “the police also have a responsibility to ensure they get all of the evidence.” The screen shots of Shirdon’s conversation with Makuch provide raw and unfiltered evidence that’s in addition to any comments he made on social media. And it might even provide exculpatory evidence, or may help with the case should Shirdon attempt to deny what he said to Makuch in a series of published articles.

As for any chilling effect on the media, Puddington said that warrants, and production orders, cannot be issued without scrutiny, and that checks and balances were upheld in this case.

VICE’s CEO Shane Smith released a statement Monday saying that the company will fully support Makuch’s fight “and call upon our journalistic brothers and sisters to do the same.”

“An attack on one journalist is an attack on all journalists. A free press is more important today than ever before and VICE News will fight to make sure that we are part of one until you shut us down,” Smith continued.

“We have actually strong safeguards and protections in place to protect the freedom of the press.”

Controversy around press freedoms has swelled in Canada recently, as revelations emerged late last year that police officers in Quebec were spying on journalists with the permission of provincial judges.

The incident appeared to trouble Prime Minister Justin Trudeau, who told reporters in November that a free press is “absolutely critical” for a free democracy and that “we have actually strong safeguards and protections in place to protect the freedom of the press.”

However, there are no shield laws in place in Canada that allows reporters to protect their sources and any confidential information.

A spokesperson for Trudeau wouldn’t answer questions from VICE News on Monday regarding Makuch’s case, instead referring queries to a spokesperson for the federal public safety minister, who also wouldn’t comment on the case as it’s before the court.