IDEA-155715 Settings Repository responds with confusing message
[idea/community.git] / plugins / settings-repository / src / settings / readOnlySourcesEditor.kt
index 875108a4f17d735ba810e9249b3cbae7212ac9bb..2672ace5735a447f718233bd5f57c2063148568d 100644 (file)
@@ -66,16 +66,7 @@ internal fun createReadOnlySourcesEditor(): ConfigurableUi<IcsSettings> {
       urlField.addBrowseFolderListener(TextBrowseFolderListener(FileChooserDescriptorFactory.createSingleFolderDescriptor()))
       urlField.textField.document.addDocumentListener(object : DocumentAdapter() {
         override fun textChanged(event: DocumentEvent) {
-          val url = StringUtil.nullize(urlField.text)
-          val enabled: Boolean
-          try {
-            enabled = url != null && url.length > 1 && icsManager.repositoryService.checkUrl(url, null)
-          }
-          catch (e: Exception) {
-            enabled = false
-          }
-
-          dialogBuilder.setOkActionEnabled(enabled)
+          dialogBuilder.setOkActionEnabled(checkUrl(urlField.text.nullize()))
         }
       })