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

Merge pull request #8857 from facchinm/allow_no_hw_folder

Fix NPEs if no hardware core is installed
This commit is contained in:
Martino Facchin 2019-05-21 09:29:17 +02:00 committed by GitHub
commit 00a7546fb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -215,7 +215,7 @@ public class ContributionsIndexer {
} }
private void syncBuiltInHardware() throws IOException { private void syncBuiltInHardware() throws IOException {
if (index == null) { if (index == null || builtInHardwareFolder == null) {
return; return;
} }
for (File folder : builtInHardwareFolder.listFiles(ONLY_DIRS)) { for (File folder : builtInHardwareFolder.listFiles(ONLY_DIRS)) {

View File

@ -676,7 +676,9 @@ public class BaseNoGui {
// Libraries located in the latest folders on the list can override // Libraries located in the latest folders on the list can override
// other libraries with the same name. // other libraries with the same name.
librariesIndexer.setLibrariesFolders(librariesFolders); librariesIndexer.setLibrariesFolders(librariesFolders);
if (getTargetPlatform() != null) {
librariesIndexer.setArchitecturePriority(getTargetPlatform().getId()); librariesIndexer.setArchitecturePriority(getTargetPlatform().getId());
}
librariesIndexer.rescanLibraries(); librariesIndexer.rescanLibraries();
populateImportToLibraryTable(); populateImportToLibraryTable();