From 0a6577f85cbb1f7868ef9df03cffb2efe7d29d94 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Wed, 10 Jun 2015 15:42:47 +0200 Subject: [PATCH] If parsing a core fails, don't crash but report a warning. Fixes #3307 --- .../contributions/packages/ContributionsIndexer.java | 12 ++++++++---- arduino-core/src/processing/app/BaseNoGui.java | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java index b457fe062..c058efeb8 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java @@ -300,7 +300,7 @@ public class ContributionsIndexer { return index.toString(); } - public List createTargetPackages() throws TargetPlatformException { + public List createTargetPackages() { List packages = new ArrayList(); if (index == null) { @@ -317,9 +317,13 @@ public class ContributionsIndexer { String arch = platform.getArchitecture(); File folder = platform.getInstalledFolder(); - TargetPlatform targetPlatform = new ContributedTargetPlatform(arch, folder, targetPackage, index); - if (!targetPackage.hasPlatform(targetPlatform)) { - targetPackage.addPlatform(targetPlatform); + try { + TargetPlatform targetPlatform = new ContributedTargetPlatform(arch, folder, targetPackage, index); + if (!targetPackage.hasPlatform(targetPlatform)) { + targetPackage.addPlatform(targetPlatform); + } + } catch (TargetPlatformException e) { + System.err.println(e.getMessage()); } } diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index 9a03ee17c..640f2d757 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -826,7 +826,7 @@ public class BaseNoGui { populateImportToLibraryTable(); } - static protected void loadContributedHardware(ContributionsIndexer indexer) throws TargetPlatformException { + static protected void loadContributedHardware(ContributionsIndexer indexer) { for (TargetPackage pack : indexer.createTargetPackages()) { packages.put(pack.getId(), pack); }