[MRM-2028] Fixing NPE on artifact removal

This commit is contained in:
Martin Schreier 2022-01-06 11:35:36 +01:00
parent 70bd7fdd3c
commit 512ff100d7
1 changed files with 3 additions and 4 deletions

View File

@ -254,13 +254,12 @@ public abstract class AbstractRepositoryPurge
if ( StringUtils.isNotBlank( reference.getClassifier( ) ) )
{
info.setClassifier( reference.getClassifier( ) );
metaRemovalList.put( info, artifactMetadata );
}
else
{
// metadataRepository.removeTimestampedArtifact( artifactMetadata, baseVersion );
metaRemovalList.put( info, artifactMetadata );
info.setClassifier( "" );
}
metaRemovalList.put( info, artifactMetadata );
}
}
}
@ -356,7 +355,7 @@ public abstract class AbstractRepositoryPurge
(MavenArtifactFacet) artifactMetadata.getFacet(
MavenArtifactFacet.FACET_ID );
if ( StringUtils.equals( artifactInfo.classifier,
if ( mavenArtifactFacet != null && StringUtils.equals( artifactInfo.classifier,
mavenArtifactFacet.getClassifier( ) ) )
{
artifactMetadata.removeFacet( MavenArtifactFacet.FACET_ID );