Skip to content

Commit

Permalink
[Fix] Fix initializing platform with overridden providers
Browse files Browse the repository at this point in the history
  • Loading branch information
eitch committed Feb 8, 2024
1 parent 77709b1 commit 6228825
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pi4j-core/src/main/java/com/pi4j/platform/PlatformBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ public <T extends IO>T create(String id, IOType ioType) {
public PLATFORM initialize(Context context) throws InitializeException {
this.context = context;
String[] provIds = getProviders();
for (String provId : provIds) {
for (String providerId : provIds) {
if (!context.providers().exists(providerId))
continue;
try {
addProvider(context, provId);
addProvider(context, providerId);
} catch (ProviderException e) {
throw new InitializeException(e.getMessage());
}
Expand Down

0 comments on commit 6228825

Please sign in to comment.