Skip to content

Commit

Permalink
Fix NPE on empty metadata parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
alecharp committed May 13, 2022
1 parent 1eea100 commit 44a7c7c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ List<String> parseVersions(final String pResponse) throws VersionReaderException

StringReader reader = new StringReader(pResponse);
xmlResult = (MavenMetaData) unmarshaller.unmarshal(reader);

for(Version current : xmlResult.getVersioning().getVersions()) {
retVal.add(current.getVersion());

if (xmlResult.getVersioning() != null) {
for(Version current : xmlResult.getVersioning().getVersions()) {
retVal.add(current.getVersion());
}
}

} catch (Exception e) {
Expand Down

0 comments on commit 44a7c7c

Please sign in to comment.