Naya Rivera reacts to ex Mark Salling's child pornography charges

MANILA, Philippines – Naya Rivera has opened up about her ex-boyfriend and former Glee co-star Mark Salling and his child pornography charges.

In an excerpt published in People of her autobiography Sorry Not Sorry, Naya said, "I can't say I was totally shocked, but still – WTF?"

She heard the news through her son's nanny, she said, continuing, "Then I had no doubt that God really did have my back along the way."

According to Naya, she and Mark dated for 3 years while on Glee, before Mark broke up with her in 2010 on the advice of his publicist, who insisted being single would be better for his image.

"When Mark dumped me, I thought it was the worst thing ever, but can you imagine if that didn't happen?" Naya continues in her memoir. "And I was laying there in bed when the battering ram came through the door?"

She added: "I think everyone should have that one relationship where you look back and ask yourself, 'What the hell was I thinking?' You'll learn something and you won't regret it. Unless, of course, that relationship was with someone who had a sizable stash of child porn on his computer. Then, by all means, regret everything."

Mark, 34, was arrested in December 2015 for alleged possession of child pornography, before he was indicted in May for receiving and keeping child pornography on his laptop.

Naya explained to Entertainment Tonight (ET) why she wasn't surprised when she first heard the news: "He was always just a very dark soul to me. I always felt like there was something that he was wrestling with."

On dating him, Naya told ET: "You make such poor decisions in who you are going to date when you are 21, 22. Especially when you haven't dated that much... You pick the hot guy, with the abs, who is kind of a bad boy."

Naya, 29, has since married Ryan Dorsey, 33, in 2014, and the couple have a son together, Josey Dorsey, who is almost one year old.

In another excerpt from her memoir, Naya opened up about her struggles with anorexia and a past abortion. –