As signs pile up that Sen. Cory Booker is preparing for a 2020 bid for the White House, his fellow New Jersey Democrats have approved a new law to make sure he can run for president and Senate at the same time.

A bill signed Thursday by Gov. Phil Murphy clarifies that candidates for the Senate or House of Representatives can also appear on the ballot for the office of president or vice president. State law prohibits most other cases of candidates running simultaneously for more than one office, such as governor and state senator.

Some Democratic lawmakers suggested the law wasn’t necessary and that Booker, who will be up for re-election in the Senate in 2020, would have legally been able to run for both offices without it. But there was enough uncertainty to prompt action.

“This was just to stop any lawsuits to slow him down,” said Senate President Stephen Sweeney, D-Gloucester, who sponsored the measure.

Republicans have accused Democrats of hypocrisy in backing the legislation, A-4674, referencing a bill Democratic lawmakers introduced in 2015 that would have forced then-Gov. Chris Christie, a Republican, to resign in order to make a presidential run. The bill never received a vote.

“Once again, Trenton’s Democrats show the depths of their duplicity,” state GOP Chairman Doug Steinhardt said in a statement last week. “If Senator Booker cared about his home state more than his own political ambitions, he would pick a job and try to do it well.”

Booker has aroused speculation about his presidential ambitions with recent trips to Iowa and New Hampshire — two states that vote early in the presidential primary elections and caucuses — and his defiant stands during high-profile Senate business.

During the confirmation hearings of Supreme Court Associate Justice Brett Kavanaugh, for example, Booker vowed to share documents labeled “committee confidential” and said he was experiencing something close to an “’I am Spartacus’ moment” when his Democratic colleagues promised to back him up should he be punished.

The new law doesn’t reference Booker by name, but it is specially tailored for his likely situation.

Republicans back home said Booker should be forced to decide which office to run for. Ahead of a Senate vote on the legislation Monday, Sen. Robert Singer, R-Ocean, contrasted the measure to New Jersey’s 2007 ban on dual office-holding.

“We’re going back on the same thing we condemned,” Singer said. “And now all of sudden we’re saying it’s OK to do it when it’s good for us.”

“Spartacus had the courage to make decisions,” Sen. Gerald Cardinale, R-Bergen, added of Booker. “He ain’t no Spartacus.”