A judge has ruled that Los Angeles County Sheriff’s Department deputies followed procedure in their search of L.A. County Supervisor Sheila Kuehl’s Malibu home.

“The judge shot down any claim that Sheila Kuehl had that the law enforcement, that the sheriff’s office, went forum shopping to find a friendly judge. The judge in this case said ‘No, this is who they were sent to to procure of the warrant,’ and it was done by the book,” said legal expert Alison Triessl.

During the search, investigators found a series of text messages showing that Kuehl was tipped off about the impending search.

“Sheila Kuehl’s counsel says this was beyond the scope of the search warrant, it was not what the judge signed off agreeing to have searched, and ‘you may have violated my attorney-client privilege,’” Triessl said.

The sheriff’s investigation stems from allegations of political corruption against the Metropolitan Transportation Authority, such as that Kuehl played favorites and awarded contracts to a nonprofit run by a close friend instead of getting bids from the public.

Kuehl refutes those claims and says Sheriff Alex Villanueva, with whom she has repeatedly butted heads, is pursuing the investigation for political reasons.

Because of the long-standing feud and possible conflict of interest, California Attorney General Rob Bonta has taken over the case.