void (@NotNull Runnable task) { ModalityUiUtil.invokeLaterIfNeeded(ModalityState.stateForComponent(mySplitter), () -> { VcsSelectionHistoryDialog dialog = VcsSelectionHistoryDialog.this; if (!dialog.isDisposed() && dialog.getFrame().isShowing()) { task.run(); } }); }