@@ -90,22 +90,24 @@ public CursorResult<List<AssetAdministrationShellDescriptor>> getAllAasDescripto
9090 AggregationResults <AssetAdministrationShellDescriptor > results = template .aggregate (Aggregation .newAggregation (allAggregations ), collectionName , AssetAdministrationShellDescriptor .class );
9191 List <AssetAdministrationShellDescriptor > foundDescriptors = results .getMappedResults ();
9292 String cursor = resolveCursor (pRequest , foundDescriptors , AssetAdministrationShellDescriptor ::getId );
93- foundDescriptors .forEach (desc -> {
94- List <SpecificAssetId > newIdsWithoutExternalSubjectID = new ArrayList <>();
95- if (desc .getSpecificAssetIds () != null || !desc .getSpecificAssetIds ().isEmpty ()) {
96- desc .getSpecificAssetIds ().forEach (sId -> {
97- SpecificAssetId newId = new SpecificAssetId (sId .getName (), sId .getValue ());
98- if (!sId .getSupplementalSemanticIds ().isEmpty ()){
99- newId .setSupplementalSemanticIds (sId .getSupplementalSemanticIds ());
100- }
101- if (sId .getSemanticId () != null ) {
102- newId .setSemanticId (sId .getSemanticId ());
103- }
104- newIdsWithoutExternalSubjectID .add (newId );
105- });
106- desc .setSpecificAssetIds (newIdsWithoutExternalSubjectID );
107- }
108- });
93+ try {
94+ foundDescriptors .forEach (desc -> {
95+ List <SpecificAssetId > newIdsWithoutExternalSubjectID = new ArrayList <>();
96+ if (desc .getSpecificAssetIds () != null || !desc .getSpecificAssetIds ().isEmpty ()) {
97+ desc .getSpecificAssetIds ().forEach (sId -> {
98+ SpecificAssetId newId = new SpecificAssetId (sId .getName (), sId .getValue ());
99+ if (!sId .getSupplementalSemanticIds ().isEmpty ()) {
100+ newId .setSupplementalSemanticIds (sId .getSupplementalSemanticIds ());
101+ }
102+ if (sId .getSemanticId () != null ) {
103+ newId .setSemanticId (sId .getSemanticId ());
104+ }
105+ newIdsWithoutExternalSubjectID .add (newId );
106+ });
107+ desc .setSpecificAssetIds (newIdsWithoutExternalSubjectID );
108+ }
109+ });
110+ } catch (Exception ignored ){}
109111 return new CursorResult <>(cursor , foundDescriptors );
110112 }
111113
@@ -164,6 +166,7 @@ public AssetAdministrationShellDescriptor getAasDescriptor(@NonNull String aasDe
164166 if (descriptor == null ) {
165167 throw new AasDescriptorNotFoundException (aasDescriptorId );
166168 }
169+ try {
167170 List <SpecificAssetId > newIdsWithoutExternalSubjectID = new ArrayList <>();
168171 if (descriptor .getSpecificAssetIds () != null || !descriptor .getSpecificAssetIds ().isEmpty ()) {
169172 descriptor .getSpecificAssetIds ().forEach (sId -> {
@@ -178,6 +181,8 @@ public AssetAdministrationShellDescriptor getAasDescriptor(@NonNull String aasDe
178181 });
179182 descriptor .setSpecificAssetIds (newIdsWithoutExternalSubjectID );
180183 }
184+ } catch (Exception ignored ){}
185+
181186 return descriptor ;
182187 }
183188
0 commit comments