1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

Fix NPEs if no hardware core is installed

Fixes #8229
This commit is contained in:
Martino Facchin 2019-05-06 15:10:33 +02:00
parent c3675a8bef
commit d518d7683c
2 changed files with 4 additions and 2 deletions

View File

@ -215,7 +215,7 @@ public class ContributionsIndexer {
}
private void syncBuiltInHardware() throws IOException {
if (index == null) {
if (index == null || builtInHardwareFolder == null) {
return;
}
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
// other libraries with the same name.
librariesIndexer.setLibrariesFolders(librariesFolders);
librariesIndexer.setArchitecturePriority(getTargetPlatform().getId());
if (getTargetPlatform() != null) {
librariesIndexer.setArchitecturePriority(getTargetPlatform().getId());
}
librariesIndexer.rescanLibraries();
populateImportToLibraryTable();