void (@NotNull Runnable runnable) { TreeModel model = tree.getModel(); if (model instanceof AsyncTreeModel async) { if (async.isProcessing()) { invokeLater(() -> invokeAfterProcessing(runnable)); return; // do nothing if delayed } } invokeSafely(runnable); }