From deafca021478eaaa909a01e36cc84083a9c33d62 Mon Sep 17 00:00:00 2001 From: Eugene Petrenko Date: Sat, 21 Mar 2020 18:05:00 +0100 Subject: [PATCH] EA-226344 - do not show JdkDownloader dialog if no items were found in the list It is a rare case we have no items in the feed. It is most likely caused by a MITM proxy or anything that corrupts our jdks.json GitOrigin-RevId: ae9915f1065543966780a585f7003e69160c90a0 --- .../projectRoots/impl/jdkDownloader/JdkDownloader.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkDownloader.kt b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkDownloader.kt index bf8c8ea0c6ec..5c5f00dc0c24 100644 --- a/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkDownloader.kt +++ b/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkDownloader.kt @@ -44,6 +44,16 @@ internal class JdkDownloader : SdkDownload, JdkDownloaderBase { } ?: return if (project?.isDisposed == true) return + + if (items.isEmpty()) { + Messages.showMessageDialog(project, + "No JDK packages are available for download", + JdkDownloadDialog.DIALOG_TITLE, + Messages.getErrorIcon() + ) + return + } + val (jdkItem, jdkHome) = JdkDownloadDialog(project, parentComponent, sdkTypeId, items).selectJdkAndPath() ?: return /// prepare the JDK to be installed (e.g. create home dir, write marker file)