SAN FRANCISCO —An extremely aggressive demand letter that threatened to expose a reality TV star's kinky relationship with a retired superior court judge did not amount to extortion, the Second District Court of Appeal ruled Tuesday.

The ruling is a partial win for Martin Singer, a lawyer Los Angeles Magazine once described as an attack dog for the stars. The Second District ruled that California's anti-SLAPP law shields the Lavely & Singer partner from an extortion claim, though not from a separate allegation that he and a client arranged the hacking of their opponent's computer.