Almost immediately after Justice Anthony Kennedy announced his retirement on Wednesday, Senate Democrats argued that his replacement should not be confirmed until after the midterm elections this fall — a version of the same argument that Mitch McConnell, the Senate majority leader, used to stymie President Barack Obama’s nomination of Merrick Garland to the Supreme Court in 2016.

This is surely a valid argument, not least because Mr. McConnell’s blatantly anti-democratic ploy stole a judicial appointment from a popularly elected president and gave it to one who lost the popular vote by millions.

But there is another reason to withhold confirmation that both Republicans and Democrats should be able to agree on: People under the cloud of investigation do not get to pick the judges who may preside over their cases. By this logic, President Trump should not be permitted to appoint a new Supreme Court justice until after the special counsel investigation is over, and we know for sure whether there is evidence of wrongdoing.

True, that point is unlikely to stop Mr. McConnell or his colleagues. But it highlights the real risk involved in letting a deeply compromised president shape a court that may one day stand between him and impeachment.