mirror of https://github.com/apache/maven.git
avoid potential NPE
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@219831 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e40e709513
commit
f48d2c367c
|
@ -79,22 +79,22 @@ public class SnapshotTransformation
|
|||
}
|
||||
else if ( isSnapshot( artifact ) )
|
||||
{
|
||||
SnapshotArtifactMetadata metadata = null;
|
||||
|
||||
try
|
||||
{
|
||||
SnapshotArtifactMetadata metadata;
|
||||
|
||||
metadata = (SnapshotArtifactMetadata) retrieveFromRemoteRepository( artifact, remoteRepository, null );
|
||||
|
||||
metadata.update();
|
||||
|
||||
artifact.setVersion( metadata.constructVersion() );
|
||||
|
||||
artifact.addMetadata( metadata );
|
||||
}
|
||||
catch ( ResourceDoesNotExistException e )
|
||||
{
|
||||
// ignore. We'll be creating this metadata if it doesn't exist...
|
||||
}
|
||||
|
||||
metadata.update();
|
||||
|
||||
artifact.setVersion( metadata.constructVersion() );
|
||||
|
||||
artifact.addMetadata( metadata );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue