Rather than pass along condolences and offer words of encouragement following the death of Bethenny Frankel’s on-off boyfriend, Dennis Shields, her ex husband, Jason Hoppy, is working the tragic news to his advantage. Yep, Hoppy — father of their 8-year-old daughter Bryn — is actually bring the passing of the Real Housewives of New York star's love interest to court.

Shields was found dead of a suspected overdose in his Trump Tower apartment on Friday, and Franklin, who reportedly discussed marriage and received an engagement ring from him, both attended his funeral and mourned over her loss on Instagram, sharing a photo of her late dog Cookie and Shields together.

According to Page Six, Hoppy is now using Shields’s suspected drug use against Frankel in an attempt to win custody of their daughter. “It was reported that he died of an Oxycodone overdose. Our concern is while his death is very sad this raises serious concerns about Ms. Frankel’s parental judgment,” Hoppy’s attorney Robert Wallack said in a court hearing on Thursday.

Frankel filed for divorce from Hoppy in 2013, and their relationship history is rather complicated. In December, she sued him for full custody of their daughter Bryn after settling on a co-parenting agreement. The suit followed charges made against Hoppy for stalking and harassing Frankel.

In court this week, Hoppy’s lawyer added that Shields’s involvement in Bryn’s life paints Frankel as an inadequate parent since he spent “a great deal of time” with Bryn and often looked after her without Frankel's presence.

“Considering Mr. Shields’ addiction, what does that say about Ms. Frankel’s parenting that she would allow this person to care for her daughter? This doesn’t just constitute a lapse in judgment this was just downright dangerous parenting,” Wallack said.

Striking another blow, Wallack also referenced a recent Real Housewives episode in which Frankel “appeared to be intoxicated.” “She was running around without clothes on and then she passed out and it was said she passed out from mixing Ambien with alcohol,” he told the judge. “Our concerns are whether Ms. Frankel may have some type of substance abuse problems so we would ask the court to order drug testing of Ms. Frankel to find out whether that’s an issue.”

Apparently, Frankel was in tears inside the courtroom while the judge accused Wallack of “throwing grenades across the table,” especially considering Hoppy previously seemed pleased with his shared custody. A hearing to settle the custody battle has been set for mid-March.