@@ -158,7 +158,6 @@ public void updateArtifacts(String engagementUuid, String region, List<Artifact>
158
158
}
159
159
160
160
}
161
-
162
161
163
162
/**
164
163
* Returns a {@link List} of {@link Artifact}s matching the specified
@@ -170,7 +169,7 @@ public void updateArtifacts(String engagementUuid, String region, List<Artifact>
170
169
public List <Artifact > getArtifacts (GetListOptions options ) {
171
170
172
171
if (!options .getRegion ().isEmpty () && options .getType ().isPresent ()) { //by region and type
173
- return Artifact .pagedArtifactsByRegionAndType (options .getType ().get ( ), options .getRegion (), options .getPage (),
172
+ return Artifact .pagedArtifactsByRegionAndType (options .getType ().orElse ( "" ), options .getRegion (), options .getPage (),
174
173
options .getPageSize (), options .getQuerySort ());
175
174
}
176
175
@@ -180,7 +179,7 @@ public List<Artifact> getArtifacts(GetListOptions options) {
180
179
181
180
if (options .getType ().isPresent ()) { //by type
182
181
checkEngagementUuid (options .getEngagementUuid ());
183
- return Artifact .pagedArtifactsByType (options .getType ().get ( ), options .getPage (), options .getPageSize (), options .getQuerySort ());
182
+ return Artifact .pagedArtifactsByType (options .getType ().orElse ( "" ), options .getPage (), options .getPageSize (), options .getQuerySort ());
184
183
}
185
184
186
185
Optional <String > engagementUuid = options .getEngagementUuid ();
@@ -211,17 +210,18 @@ private void checkEngagementUuid(Optional<String> engagementUuid) {
211
210
* @return
212
211
*/
213
212
public ArtifactCount countArtifacts (GetOptions options ) {
213
+ String type = options .getType ().orElse ("" );
214
214
215
215
Optional <String > engagementUuid = options .getEngagementUuid ();
216
216
217
217
ArtifactCount count ;
218
218
219
219
if (!options .getRegion ().isEmpty () && options .getType ().isPresent ()) {
220
- count = Artifact .countArtifactsByRegionAndType (options . getType (). get () , options .getRegion ());
220
+ count = Artifact .countArtifactsByRegionAndType (type , options .getRegion ());
221
221
} else if (!options .getRegion ().isEmpty ()) {
222
222
count = Artifact .countArtifactsByRegion (options .getRegion ());
223
223
} else if (options .getType ().isPresent ()) {
224
- count = Artifact .countArtifactsByType (options . getType (). get () );
224
+ count = Artifact .countArtifactsByType (type );
225
225
} else if (engagementUuid .isPresent ()) {
226
226
count = Artifact .countArtifactsByEngagementUuid (engagementUuid .get ());
227
227
} else {
0 commit comments