@@ -121,9 +121,14 @@ public Collection<Result> getResultsForClass(JwtAuthenticationToken token, @Path
121121 UserContext userContext = (UserContext ) token .getPrincipal ();
122122
123123 Collection <LineItem > lineItems = this .lineItemService .getLineItemsForClass (userContext .getTenantId (), userContext .getOrgId (), classId );
124- ArrayList <Result > results = new ArrayList <Result >();
124+ ArrayList <Result > results = new ArrayList <>();
125+ Collection <Result > lineItemResults ;
125126 for (LineItem lineItem : lineItems ) {
126- Collection <Result > lineItemResults = this .resultService .getResultsForlineItem (userContext .getTenantId (), userContext .getOrgId (), lineItem .getSourcedId ());
127+ try {
128+ lineItemResults = this .resultService .getResultsForlineItem (userContext .getTenantId (), userContext .getOrgId (), lineItem .getSourcedId ());
129+ }catch (ResultNotFoundException e ) {
130+ continue ;
131+ }
127132 results .addAll (lineItemResults );
128133 }
129134
@@ -171,7 +176,7 @@ public ClassMapping getClassMapping(JwtAuthenticationToken token, @PathVariable(
171176 public ResponseEntity <?> postClassMapping (JwtAuthenticationToken token , @ RequestBody ClassMapping cm ) {
172177 UserContext userContext = (UserContext ) token .getPrincipal ();
173178
174- ClassMapping classMapping = null ;
179+ ClassMapping classMapping ;
175180
176181 ClassMapping existingClassMapping = mongoClassMappingRepository
177182 .findByTenantIdAndOrganizationIdAndClassExternalId (userContext .getTenantId (), userContext .getOrgId (), cm .getClassExternalId ());
0 commit comments