Skip to content

Commit

Permalink
GH-64 StringIndexOutOfBoundsException in some invalid metadata reques…
Browse files Browse the repository at this point in the history
…ts (Resolve #64)
  • Loading branch information
dzikoysk committed May 18, 2020
1 parent 6aefd55 commit 5097ba8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public final class MetadataService {
String latestIdentifier = Objects.requireNonNull(MetadataUtils.getLatest(identifiers));
int buildSeparatorIndex = latestIdentifier.lastIndexOf("-");

// not a snapshot request, missing build number
if (buildSeparatorIndex == -1) {
return null;
}

String latestTimestamp = latestIdentifier.substring(0, buildSeparatorIndex);
String latestBuildNumber = latestIdentifier.substring(buildSeparatorIndex + 1);

Expand Down

0 comments on commit 5097ba8

Please sign in to comment.