Sen. Cory Booker is right: Joe Biden is trying to have it both ways with his relationship to former President Barack Obama.

The former vice president was challenged Wednesday during the fourth Democratic primary debate in Detroit to answer whether he did anything during Obama years to curb the administration’s massive deportation of illegals immigrants.

Biden tried at first to dodge the question. He settled eventually on throwing his former employer under the bus.

New York City Mayor Bill de Blasio, who prompted the moment, went after the 2020 Democratic front-runner’s record on immigration enforcement, saying, “I asked the vice president point-blank: Did he use his power to stop those deportations? He went right around the question.”

“Mr. Vice President, if you want to be president of the United States, you need to be able to answer the tough questions. I guarantee you, if you’re debating Donald Trump, he’s not going to let you off the hook,” the mayor added. “Did you say those deportations were a good idea? Or did you go to the president and say, ‘This is a mistake. We shouldn’t do it?’ Which one?”

Biden panicked.

“I was vice president. I’m not the president. I keep my recommendation in private. Unlike you, I expect you would go ahead and say whatever was said privately. That is not what I do. What I do say to you is, he moved to fundamentally change the system. That’s what he did. That’s what he did. But much more has to be done, much more has to be done,” Biden said.

Booker jumped in at that moment to hit the former vice president for trying to wiggle out of the question at Obama’s expense.

“Mr. Vice President, you can't have it both ways,” the New Jersey senator said. “You invoke President Obama more than anybody in this campaign; you can’t do it when it’s convenient and then dodge it when it’s not.”

It is true, that part about Biden invoking Obama’s name. The former vice president, who claims he does not want 44’s endorsement, brings up the former president a lot on the campaign trail. So much so, in fact, that it makes Biden’s remarks about not wanting an endorsement look like a flat-out lie.

The former vice president constantly name-drops Obama at campaign events, referring to himself often as an “Obama-Biden Democrat.” Biden claims President Trump inherited the “Obama-Biden” economy. Then there are the social media posts from Biden’s campaign team. Oh, the social media posts:

Funny. For all the praise Biden heaps on his former boss, and all the nostalgia he appeals to, he panicked the moment someone brought up one of the many, many uncomfortable truths about how the Obama administration went about its business.

If Biden thinks de Blasio’s line of questions was rough, resulting in him pulling the ripcord, just wait until people start asking questions about the Obama administration’s extrajudicial droning of American citizens.