Mitigates #3074 by avoiding NPE. Making the IDE work with system toolchains remains to be fixed

This commit is contained in:
Federico Fissore 2015-05-04 17:28:39 +02:00
parent 724df07fb8
commit 875a775e93
1 changed files with 5 additions and 3 deletions

View File

@ -775,9 +775,11 @@ public class BaseNoGui {
PreferencesData.removeAllKeysWithPrefix(prefix);
for (ContributedTool tool : indexer.getInstalledTools()) {
String path = tool.getDownloadableContribution().getInstalledFolder().getAbsolutePath();
PreferencesData.set(prefix + tool.getName() + ".path", path);
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", path);
File installedFolder = tool.getDownloadableContribution().getInstalledFolder();
if (installedFolder != null) {
PreferencesData.set(prefix + tool.getName() + ".path", installedFolder.getAbsolutePath());
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", installedFolder.getAbsolutePath());
}
}
}