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
This commit is contained in:
Eugene Petrenko
2020-03-21 18:40:27 +00:00
committed by intellij-monorepo-bot
parent ac163e1235
commit deafca0214
@@ -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)