EA-40093 - NPE: UpdateChecker.install

This commit is contained in:
anna
2012-10-18 13:45:04 +02:00
parent 9598ba568c
commit c322a6e283
2 changed files with 11 additions and 9 deletions
@@ -105,7 +105,7 @@ public class InstalledPluginsTableModel extends PluginTableModel {
return false;
}
public static void updateExistingPlugin(IdeaPluginDescriptor descriptor, IdeaPluginDescriptor existing) {
public static void updateExistingPlugin(IdeaPluginDescriptor descriptor, @Nullable IdeaPluginDescriptor existing) {
if (existing != null) {
updateExistingPluginInfo(descriptor, existing);
updatedPlugins.add(existing.getPluginId());
@@ -601,14 +601,16 @@ public final class UpdateChecker {
boolean installed = false;
for (PluginDownloader downloader : downloaders) {
if (getDisabledToUpdatePlugins().contains(downloader.getPluginId())) continue;
try {
final IdeaPluginDescriptor descriptor = downloader.getDescriptor();
InstalledPluginsTableModel.updateExistingPlugin(descriptor, PluginManager.getPlugin(descriptor.getPluginId()));
downloader.install();
installed = true;
}
catch (IOException e) {
LOG.info(e);
final IdeaPluginDescriptor descriptor = downloader.getDescriptor();
if (descriptor != null) {
try {
InstalledPluginsTableModel.updateExistingPlugin(descriptor, PluginManager.getPlugin(descriptor.getPluginId()));
downloader.install();
installed = true;
}
catch (IOException e) {
LOG.info(e);
}
}
}
return installed;