void (@NotNull ProgressIndicator indicator) { int offset = ReadAction.compute(() -> element.isValid() ? element.getTextOffset() : -1); // may trigger decompilation indicator.checkCanceled(); if (offset >= 0) { Navigatable descriptor = PsiNavigationSupport.getInstance().createNavigatable(myProject, file, offset); Condition isValid = __ -> !file.isValid(); Condition isDisposed = myProject.getDisposed(); Condition<?> expired = or(isDisposed, isValid); ApplicationManager.getApplication().invokeLater(() -> descriptor.navigate(requestFocus), expired); } }