In an attempt to evade a major civil lawsuit in New York that might hasten its demise, the National Rifle Association sought bankruptcy protection. But on Tuesday, a federal judge blocked the maneuver.

“The Court finds, based on the totality of the circumstances, that the NRA’s bankruptcy petition was not filed in good faith but instead was filed as an effort to gain an unfair litigation advantage in the [New York Attorney General’s] Enforcement Action and as an effort to avoid a regulatory scheme,” Judge Harlin Hale wrote.

Now the NRA must face New York Attorney General Letitia James’ lawsuit, which seeks to dissolve the NRA. Business Insider provides context:

While reports of financial troubles have dogged the NRA for years, its bankruptcy filings showed it was financially solvent and had assets worth roughly $50 million more than its debts. The organization tried to restructure in Texas, claiming New York had a corrupt regulatory environment.

Prosecutors for James’s office viewed the bankruptcy filing as an attempt to squirm out of the litigation. Hale’s decision sides with those prosecutors, effectively giving a green light to James’s office to continue its lawsuit.

“The @NRA does not get to dictate if and where it will answer for its actions, and our case will continue in New York court,” the New York AG’s office tweeted after the ruling. “No one is above the law.”

According to CNN, James’ suit “alleges NRA leadership used millions from the group’s reserves to fund lavish trips on private jets, meals and other personal expenses and that money was diverted to benefit NRA insiders and favored vendors, that Chief Executive Officer Wayne LaPierre handpicked associates to “facilitate his misuse of charitable assets” and that the NRA board did not follow an appropriate process to determine “reasonable” compensation for NRA executives, including LaPierre.”

The bankruptcy hearing before Judge Hale laid bare some the NRA’s dysfunction. LaPierre was repeatedly accused of mismanagement and inappropriate spending. Even former allies turned on him. From The Washington Post:

LaPierre testified twice during the trial, which was conducted via Webex video conference. He acknowledged that he should have disclosed some of the lavish benefits he received and that he clashed with many former executives and associates, including the leaders of Ackerman McQueen, the NRA’s longtime public relations firm, which claims the NRA owes it more than $1 million. But he said past financial and management abuses had been corrected.

John Feinblatt, president of Everytown for Gun Safety, issued a statement after the ruling:

“Today’s disastrous decision for the NRA shows that they can’t even file for bankruptcy correctly, which doesn’t bode well for the many lawsuits and investigations they must now face. The NRA was forced to hang its dirty laundry out for the world to see, and has nothing to show for it but another stack of legal bills.”