1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

If parsing a core fails, don't crash but report a warning. Fixes #3307

This commit is contained in:
Federico Fissore 2015-06-10 15:42:47 +02:00
parent c1c5e70fe1
commit 0a6577f85c
2 changed files with 9 additions and 5 deletions

View File

@ -300,7 +300,7 @@ public class ContributionsIndexer {
return index.toString();
}
public List<TargetPackage> createTargetPackages() throws TargetPlatformException {
public List<TargetPackage> createTargetPackages() {
List<TargetPackage> packages = new ArrayList<TargetPackage>();
if (index == null) {
@ -317,10 +317,14 @@ public class ContributionsIndexer {
String arch = platform.getArchitecture();
File folder = platform.getInstalledFolder();
try {
TargetPlatform targetPlatform = new ContributedTargetPlatform(arch, folder, targetPackage, index);
if (!targetPackage.hasPlatform(targetPlatform)) {
targetPackage.addPlatform(targetPlatform);
}
} catch (TargetPlatformException e) {
System.err.println(e.getMessage());
}
}
if (targetPackage.hasPlatforms()) {

View File

@ -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);
}