Skip to content

Commit 875a775

Browse files
author
Federico Fissore
committed
Mitigates #3074 by avoiding NPE. Making the IDE work with system toolchains remains to be fixed
1 parent 724df07 commit 875a775

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arduino-core/src/processing/app/BaseNoGui.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,11 @@ static private void createToolPreferences(ContributionsIndexer indexer) {
775775
PreferencesData.removeAllKeysWithPrefix(prefix);
776776

777777
for (ContributedTool tool : indexer.getInstalledTools()) {
778-
String path = tool.getDownloadableContribution().getInstalledFolder().getAbsolutePath();
779-
PreferencesData.set(prefix + tool.getName() + ".path", path);
780-
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", path);
778+
File installedFolder = tool.getDownloadableContribution().getInstalledFolder();
779+
if (installedFolder != null) {
780+
PreferencesData.set(prefix + tool.getName() + ".path", installedFolder.getAbsolutePath());
781+
PreferencesData.set(prefix + tool.getName() + "-" + tool.getVersion() + ".path", installedFolder.getAbsolutePath());
782+
}
781783
}
782784
}
783785

0 commit comments

Comments
 (0)