Skip to content

Commit d518d76

Browse files
committed
Fix NPEs if no hardware core is installed
Fixes arduino#8229
1 parent c3675a8 commit d518d76

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public void syncWithFilesystem() throws IOException {
215215
}
216216

217217
private void syncBuiltInHardware() throws IOException {
218-
if (index == null) {
218+
if (index == null || builtInHardwareFolder == null) {
219219
return;
220220
}
221221
for (File folder : builtInHardwareFolder.listFiles(ONLY_DIRS)) {

Diff for: arduino-core/src/processing/app/BaseNoGui.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,9 @@ static public void onBoardOrPortChange() {
676676
// Libraries located in the latest folders on the list can override
677677
// other libraries with the same name.
678678
librariesIndexer.setLibrariesFolders(librariesFolders);
679-
librariesIndexer.setArchitecturePriority(getTargetPlatform().getId());
679+
if (getTargetPlatform() != null) {
680+
librariesIndexer.setArchitecturePriority(getTargetPlatform().getId());
681+
}
680682
librariesIndexer.rescanLibraries();
681683

682684
populateImportToLibraryTable();

0 commit comments

Comments
 (0)