Skip to content

Commit 8d85804

Browse files
committed
Fixes InMemory Implementation of filtering
1 parent 8395bc0 commit 8d85804

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • basyx.aasservice/basyx.aasservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasservice/backend

basyx.aasservice/basyx.aasservice-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasservice/backend/InMemoryAasBackend.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,11 @@ public Iterable<AssetAdministrationShell> getAllAas(List<SpecificAssetId> assetI
133133
boolean matchesGlobalAssetId = globalAssetIds.isEmpty();
134134
for (SpecificAssetId globalAssetId : globalAssetIds){
135135
String id = globalAssetId.getValue();
136-
if (aas.getAssetInformation().getGlobalAssetId().equals(id)){
137-
matchesGlobalAssetId = true;
138-
} else {
136+
if (aas.getAssetInformation() == null || aas.getAssetInformation().getGlobalAssetId() == null || !aas.getAssetInformation().getGlobalAssetId().equals(id)) {
139137
matchesGlobalAssetId = false;
140138
break;
141139
}
140+
matchesGlobalAssetId = true;
142141
}
143142
if (matchesAssetIds && matchesIdShort && matchesGlobalAssetId) {
144143
filteredAas.add(aas);

0 commit comments

Comments
 (0)