The government’s right to search travelers’ electronic devices at the border was upheld in a ruling released by a federal judge on Tuesday, which dismissed a lawsuit challenging this policy.

In his opinion, Judge Edward R. Korman of the Federal District Court for the Eastern District of New York found that the plaintiffs did not have standing for their lawsuit because such searches occur so rarely that “there is not a substantial risk that their electronic devices will be subject to a search or seizure without reasonable suspicion.”

Even if the plaintiffs did have standing, Judge Korman found that they would lose on the merits of the case, ruling that the government does not need reasonable suspicion to examine or confiscate a traveler’s laptop, cellphone or other device at the border.

“There’s no silver lining to this decision,” said Catherine Crump, a lawyer for the American Civil Liberties Union, which represented the plaintiffs. “It’s not just that we lost the case. It’s that the judge decided against us on multiple alternative grounds.”