24 of the 26 charges against Sandra Bullock’s alleged stalker, Joshua James Corbett, may potentially be dismissed.

Judge Edmund Clarke has ruled that the more than 30 guns found at Corbett’s home were obtained improperly. Clarke determined that the man’s rights were violated while in police custody, leading him to involuntarily give police permission to search his home.

RELATED: Sandra Bullock Explains Why She’ll Never Take A Selfie

Police were initially called to Bullock’s home after Corbett allegedly climbed a fence to access the actress’ home, leading her to hide in a closet and call 911.

The court’s decision to dismiss the trove of weapons could impact 24 of the 26 felony charges against Corbett. The two charges that would remain from the alleged incident would be first-degree residential burglary and stalking.

RELATED: Sandra Bullock’s 911 Tape: Actress Terrified

An attorney for Corbett, Steve Sitkoff, told Buzzfeed that police did not respect the rights of the accused: “The police stomped on his rights, he continually told them, ‘I don’t want to talk to you, I don’t want to talk to you,’ and they ignored him.”

Corbett allegedly broke into Bullock’s home in mid-2014.