From 875a775e9330bda0390cb4ac6bcbd5b2fc483c82 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Mon, 4 May 2015 17:28:39 +0200 Subject: [PATCH] Mitigates #3074 by avoiding NPE. Making the IDE work with system toolchains remains to be fixed --- arduino-core/src/processing/app/BaseNoGui.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index 06e807fbe..dccad8e96 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -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()); + } } }