Need to check compatibility when checking plugin from custom repository (KT-25714)

There's no no range check is done on the server side for custom urls not
from IntelliJ plugins repository.

 #KT-25714 Fixed
This commit is contained in:
Nikolay Krasko
2018-07-25 14:59:52 +03:00
parent 4d1b8405cb
commit fb6bb0c8b7
@@ -212,8 +212,10 @@ class KotlinPluginUpdater(val propertiesComponent: PropertiesComponent) : Dispos
return PluginUpdateStatus.fromException("Checking custom plugin repository $host failed", e)
}
val kotlinPlugin =
plugins.find { it.pluginId == KotlinPluginUtil.KOTLIN_PLUGIN_ID } ?: return PluginUpdateStatus.LatestVersionInstalled
val kotlinPlugin = plugins.find { pluginDescriptor ->
pluginDescriptor.pluginId == KotlinPluginUtil.KOTLIN_PLUGIN_ID && PluginManagerCore.isCompatible(pluginDescriptor)
} ?: return PluginUpdateStatus.LatestVersionInstalled
return updateIfNotLatest(kotlinPlugin, host)
}