Jennifer Garner, Ben Affleck in "Daredevil"

Ben Affleck wasn’t given a heads up about that line in “Deadpool & Wolverine.”

In the Marvel film, Jennifer Garner returns as Elektra and makes a joke about Affleck, who she was married to for 10 years.

Shawn Levy, the director of the film, revealed on Josh Horowitz’s “Happy Sad Confused” podcast on Monday that he didn’t seek out Affleck’s approval for the jab.

Shawn Levy
“Deadpool & Wolverine” director Shawn Levy talks with Josh Horowitz on the “Happy Sad Confused” podcast

Jennifer Garner, Ben Affleck in "Daredevil"


Jennifer Garner and Ben Affleck star in “Daredevil.”

However, Levy did reveal that he had a conversation with Affleck, 51, about a different part of the film.

“I later spoke with Ben because the end credits have this tribute reel to the legacy of Fox Marvel movies and so that gave us the occasion to speak to everyone because we needed and wanted everyone’s permission,” he said.

Ryan Reynolds and Hugh Jackman in "Deadpool and Wolverine"
Ryan Reynolds and Hugh Jackman in “Deadpool & Wolverine.”

Jennifer Garner as Elektra
Jennifer Garner as Elektra

Levy added, “That joke was not, as far as I know, vetted by Ben.”

“But we made clear to Jen — as we made clear to everyone — everything’s on the table in ‘Deadpool,’ ” he explained.

Jennifer Garner, Ben Affleck in LA on June 11, 2024
Jennifer Garner and Ben Affleck in LA on June 11, 2024

In the third “Deadpool” movie, Garner’s Elektra shows up to rescue a group of heroes, including Ryan Reynolds’ Deadpool and Hugh Jackman’s Wolverine.

Jennifer Garner as Elektra

After learning that Daredevil — originally played by Affleck — has died, Deadpool offers Elektra his condolences.

“It’s fine,” Garner, 52, responds with a shrug.

Jennifer Garner, Ben Affleck in "Daredevil"
Jennifer Garner and Ben Affleck star in “Daredevil.”

The film also features a joke about Jackman’s separation from his wife of 27 years, Deborra-Lee Furness.

“He’s usually shirtless,” Deadpool says of Wolverine. “But he’s let himself go since the divorce.”

Levy addressed the double divorce jabs in an interview with Variety.

“We never did a joke about or with anyone that we didn’t run by them first,” he said. “Whether it was scripted, like the Daredevil line, or unscripted.”

Garner and Affleck fell in love on the set of 2003’s “Daredevil.” They got married in 2005 and had three children together: Violet, 18, Seraphina, 15, and Samuel, 12.

Jennifer Garner, Ben Affleck at the 2007 Golden Globes
Jennifer Garner and Ben Affleck walk the red carpet at the 2007 Golden Globes

Levy told Variety that Affleck’s Daredevil was in early contention to be brought back for “Deadpool & Wolverine.”

“Early on, when we were looking at a 70-name menu of Marvel characters, Daredevil was on one of those lists, but never since those earliest of conversations, and never to the point of outreach or offers or anything like that,” he said.

“We made contact with everyone featured in the Fox tribute reel halfway through our end credits — and that’s dozens of actors who have been a part of that legacy. That was fun to build a love letter to those years, those characters, and all the actors who played them,” Levy added.

Ryan Reynolds, Emma Corrin, Jennifer Garner, Hugh Jackman, and Dafne Keen at Comic-Con 2024
Ryan Reynolds (from left), Emma Corrin, Jennifer Garner, Hugh Jackman and Dafne Keen at Comic-Con 2024

Affleck and Garner announced their breakup in 2015. They finalized their divorce in 2018.

In 2020, Affleck called his divorce from Garner “the biggest regret of my life.”

“Shame is really toxic,” he told the New York Times. “There is no positive by-product of shame. It’s just stewing in a toxic, hideous feeling of low self-worth and self-loathing.”

Ben Affleck, Jennifer Garner in 2013
Ben Affleck and Jennifer Garner in 2013

Garner has recently been supporting Affleck as his divorce from his new wife, Jennifer Lopez, seems imminent.

Affleck married Lopez, 55, in 2022. They were originally engaged in the early 2000s prior to his relationship with Garner, but they broke up, only to reconcile two decades later.

Ben Affleck, Jennifer Lopez
Ben Affleck and Jennifer Lopez

Amid divorce rumors, “Bennifer” have listed their $68 million Beverly Hills mansion for sale and Affleck bought a $20.5 million home in LA for himself. They also were apart for their second wedding anniversary and Lopez’s 55th birthday last month.