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

Merge pull request #11564 from cmaglie/fix-url-error-handling

Gracefully handle malformed additional board manager urls
This commit is contained in:
Cristian Maglie 2021-05-31 09:40:15 +02:00 committed by GitHub
commit 51407cc416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,12 +144,17 @@ public class ContributionsIndexer {
index.fillCategories();
}
private List<File> get3rdPartyIndexFiles() throws MalformedURLException {
private List<File> get3rdPartyIndexFiles() {
List<File> indexFiles = new ArrayList<>();
for (String urlString : PreferencesData.getCollection(Constants.PREF_BOARDS_MANAGER_ADDITIONAL_URLS)) {
final URL url = new URL(urlString);
URL url;
try {
url = new URL(urlString);
String filename = FilenameUtils.getName(url.getPath());
indexFiles.add(getIndexFile(filename));
} catch (MalformedURLException e) {
System.err.println(format(tr("Malformed Additional Board Manager URL '{0}': {1}"), urlString, e.getMessage()));
}
}
File[] testIndexFiles = preferencesFolder.listFiles((dir, name) -> {